Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit.BehaviorBase = function(element) {
AjaxControlToolkit.BehaviorBase.initializeBase(this,[element]);this._clientStateFieldID = null;this._pageRequestManager = null;this._partialUpdateBeginRequestHandler = null;this._partialUpdateEndRequestHandler = null;}
AjaxControlToolkit.BehaviorBase.prototype = {
initialize : function() {
AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'initialize');},
dispose : function() {
AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'dispose');if (this._pageRequestManager) {
if (this._partialUpdateBeginRequestHandler) {
this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);this._partialUpdateBeginRequestHandler = null;}
if (this._partialUpdateEndRequestHandler) {
this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);this._partialUpdateEndRequestHandler = null;}
this._pageRequestManager = null;}
},
get_ClientStateFieldID : function() {
return this._clientStateFieldID;},
set_ClientStateFieldID : function(value) {
if (this._clientStateFieldID != value) {
this._clientStateFieldID = value;this.raisePropertyChanged('ClientStateFieldID');}
},
get_ClientState : function() {
if (this._clientStateFieldID) {
var input = document.getElementById(this._clientStateFieldID);if (input) {
return input.value;}
}
return null;},
set_ClientState : function(value) {
if (this._clientStateFieldID) {
var input = document.getElementById(this._clientStateFieldID);if (input) {
input.value = value;}
}
},
registerPartialUpdateEvents : function() {
if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager){
this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();if (this._pageRequestManager) {
this._partialUpdateBeginRequestHandler = Function.createDelegate(this, this._partialUpdateBeginRequest);this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest);this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);}
}
},
_partialUpdateBeginRequest : function(sender, beginRequestEventArgs) {
},
_partialUpdateEndRequest : function(sender, endRequestEventArgs) {
}
}
AjaxControlToolkit.BehaviorBase.registerClass('AjaxControlToolkit.BehaviorBase', Sys.UI.Behavior);AjaxControlToolkit.DynamicPopulateBehaviorBase = function(element) {
AjaxControlToolkit.DynamicPopulateBehaviorBase.initializeBase(this, [element]);this._DynamicControlID = null;this._DynamicContextKey = null;this._DynamicServicePath = null;this._DynamicServiceMethod = null;this._cacheDynamicResults = false;this._dynamicPopulateBehavior = null;this._populatingHandler = null;this._populatedHandler = null;}
AjaxControlToolkit.DynamicPopulateBehaviorBase.prototype = {
initialize : function() {
AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'initialize');this._populatingHandler = Function.createDelegate(this, this._onPopulating);this._populatedHandler = Function.createDelegate(this, this._onPopulated);},
dispose : function() {
if (this._populatedHandler) {
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.remove_populated(this._populatedHandler);}
this._populatedHandler = null;}
if (this._populatingHandler) {
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.remove_populating(this._populatingHandler);}
this._populatingHandler = null;}
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.dispose();this._dynamicPopulateBehavior = null;}
AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'dispose');},
populate : function(contextKeyOverride) {
if (this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != $get(this._DynamicControlID))) {
this._dynamicPopulateBehavior.dispose();this._dynamicPopulateBehavior = null;}
if (!this._dynamicPopulateBehavior && this._DynamicControlID && this._DynamicServiceMethod) {
this._dynamicPopulateBehavior = $create(AjaxControlToolkit.DynamicPopulateBehavior,
{
"id" : this.get_id() + "_DynamicPopulateBehavior",
"ContextKey" : this._DynamicContextKey,
"ServicePath" : this._DynamicServicePath,
"ServiceMethod" : this._DynamicServiceMethod,
"cacheDynamicResults" : this._cacheDynamicResults
}, null, null, $get(this._DynamicControlID));this._dynamicPopulateBehavior.add_populating(this._populatingHandler);this._dynamicPopulateBehavior.add_populated(this._populatedHandler);}
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._DynamicContextKey);}
},
_onPopulating : function(sender, eventArgs) {
this.raisePopulating(eventArgs);},
_onPopulated : function(sender, eventArgs) {
this.raisePopulated(eventArgs);},
get_dynamicControlID : function() {
return this._DynamicControlID;},
get_DynamicControlID : this.get_dynamicControlID,
set_dynamicControlID : function(value) {
if (this._DynamicControlID != value) {
this._DynamicControlID = value;this.raisePropertyChanged('dynamicControlID');this.raisePropertyChanged('DynamicControlID');}
},
set_DynamicControlID : this.set_dynamicControlID,
get_dynamicContextKey : function() {
return this._DynamicContextKey;},
get_DynamicContextKey : this.get_dynamicContextKey,
set_dynamicContextKey : function(value) {
if (this._DynamicContextKey != value) {
this._DynamicContextKey = value;this.raisePropertyChanged('dynamicContextKey');this.raisePropertyChanged('DynamicContextKey');}
},
set_DynamicContextKey : this.set_dynamicContextKey,
get_dynamicServicePath : function() {
return this._DynamicServicePath;},
get_DynamicServicePath : this.get_dynamicServicePath,
set_dynamicServicePath : function(value) {
if (this._DynamicServicePath != value) {
this._DynamicServicePath = value;this.raisePropertyChanged('dynamicServicePath');this.raisePropertyChanged('DynamicServicePath');}
},
set_DynamicServicePath : this.set_dynamicServicePath,
get_dynamicServiceMethod : function() {
return this._DynamicServiceMethod;},
get_DynamicServiceMethod : this.get_dynamicServiceMethod,
set_dynamicServiceMethod : function(value) {
if (this._DynamicServiceMethod != value) {
this._DynamicServiceMethod = value;this.raisePropertyChanged('dynamicServiceMethod');this.raisePropertyChanged('DynamicServiceMethod');}
},
set_DynamicServiceMethod : this.set_dynamicServiceMethod,
get_cacheDynamicResults : function() {
return this._cacheDynamicResults;},
set_cacheDynamicResults : function(value) {
if (this._cacheDynamicResults != value) {
this._cacheDynamicResults = value;this.raisePropertyChanged('cacheDynamicResults');}
},
add_populated : function(handler) {
this.get_events().addHandler("populated", handler);},
remove_populated : function(handler) {
this.get_events().removeHandler("populated", handler);},
raisePopulated : function(arg) {
var handler = this.get_events().getHandler("populated");if (handler) handler(this, arg);},
add_populating : function(handler) {
this.get_events().addHandler('populating', handler);},
remove_populating : function(handler) {
this.get_events().removeHandler('populating', handler);},
raisePopulating : function(eventArgs) {
var handler = this.get_events().getHandler('populating');if (handler) {
handler(this, eventArgs);}
}
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.registerClass('AjaxControlToolkit.DynamicPopulateBehaviorBase', AjaxControlToolkit.BehaviorBase);AjaxControlToolkit.ControlBase = function(element) {
AjaxControlToolkit.ControlBase.initializeBase(this, [element]);this._clientStateField = null;this._callbackTarget = null;this._onsubmit$delegate = Function.createDelegate(this, this._onsubmit);this._oncomplete$delegate = Function.createDelegate(this, this._oncomplete);this._onerror$delegate = Function.createDelegate(this, this._onerror);}
AjaxControlToolkit.ControlBase.prototype = {
initialize : function() {
AjaxControlToolkit.ControlBase.callBaseMethod(this, "initialize");if (this._clientStateField) {
this.loadClientState(this._clientStateField.value);}
if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);} else {
$addHandler(document.forms[0], "submit", this._onsubmit$delegate);}
},
dispose : function() {
if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);} else {
$removeHandler(document.forms[0], "submit", this._onsubmit$delegate);}
AjaxControlToolkit.ControlBase.callBaseMethod(this, "dispose");},
findElement : function(id) {
return $get(this.get_id() + '_' + id.split(':').join('_'));},
get_clientStateField : function() {
return this._clientStateField;},
set_clientStateField : function(value) {
if (this.get_isInitialized()) throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_CannotSetClientStateField);if (this._clientStateField != value) {
this._clientStateField = value;this.raisePropertyChanged('clientStateField');}
},
loadClientState : function(value) {
},
saveClientState : function() {
return null;},
_invoke : function(name, args, cb) {
if (!this._callbackTarget) {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_ControlNotRegisteredForCallbacks);}
if (typeof(WebForm_DoCallback)==="undefined") {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_PageNotRegisteredForCallbacks);}
var ar = [];for (var i = 0;i < args.length;i++) 
ar[i] = args[i];var clientState = this.saveClientState();if (clientState != null && !String.isInstanceOfType(clientState)) {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_InvalidClientStateType);}
var payload = Sys.Serialization.JavaScriptSerializer.serialize({name:name,args:ar,state:this.saveClientState()});WebForm_DoCallback(this._callbackTarget, payload, this._oncomplete$delegate, cb, this._onerror$delegate, true);},
_oncomplete : function(result, context) {
result = Sys.Serialization.JavaScriptSerializer.deserialize(result);if (result.error) {
throw Error.create(result.error);}
this.loadClientState(result.state);context(result.result);},
_onerror : function(message, context) {
throw Error.create(message);},
_onsubmit : function() {
if (this._clientStateField) {
this._clientStateField.value = this.saveClientState();}
return true;} 
}
AjaxControlToolkit.ControlBase.registerClass("AjaxControlToolkit.ControlBase", Sys.UI.Control);
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.Resources={
"PasswordStrength_InvalidWeightingRatios":"Strength Weighting ratios must have 4 elements",
"Animation_ChildrenNotAllowed":"AjaxControlToolkit.Animation.createAnimation cannot add child animations to type \"{0}\" that does not derive from AjaxControlToolkit.Animation.ParentAnimation",
"PasswordStrength_RemainingSymbols":"{0} symbol characters",
"ExtenderBase_CannotSetClientStateField":"clientStateField can only be set before initialization",
"RTE_PreviewHTML":"Preview HTML",
"RTE_JustifyCenter":"Justify Center",
"PasswordStrength_RemainingUpperCase":"{0} more upper case characters",
"Animation_TargetNotFound":"AjaxControlToolkit.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control.  No element or control could be found corresponding to \"{0}\"",
"RTE_FontColor":"Font Color",
"RTE_LabelColor":"Label Color",
"Common_InvalidBorderWidthUnit":"A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth",
"RTE_Heading":"Heading",
"Tabs_PropertySetBeforeInitialization":"{0} cannot be changed before initialization",
"RTE_OrderedList":"Ordered List",
"ReorderList_DropWatcherBehavior_NoChild":"Could not find child of list with id \"{0}\"",
"CascadingDropDown_MethodTimeout":"[Method timeout]",
"RTE_Columns":"Columns",
"RTE_InsertImage":"Insert Image",
"RTE_InsertTable":"Insert Table",
"RTE_Values":"Values",
"RTE_OK":"OK",
"ExtenderBase_PageNotRegisteredForCallbacks":"This Page has not been registered for callbacks",
"Animation_NoDynamicPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\" or \"{1}\"",
"Animation_InvalidBaseType":"AjaxControlToolkit.Animation.registerAnimation can only register types that inherit from AjaxControlToolkit.Animation.Animation",
"RTE_UnorderedList":"Unordered List",
"ResizableControlBehavior_InvalidHandler":"{0} handler not a function, function name, or function text",
"Animation_InvalidColor":"Color must be a 7-character hex representation (e.g. #246ACF), not \"{0}\"",
"RTE_CellColor":"Cell Color",
"PasswordStrength_RemainingMixedCase":"Mixed case characters",
"RTE_Italic":"Italic",
"CascadingDropDown_NoParentElement":"Failed to find parent element \"{0}\"",
"ValidatorCallout_DefaultErrorMessage":"This control is invalid",
"RTE_Indent":"Indent",
"ReorderList_DropWatcherBehavior_CallbackError":"Reorder failed, see details below.\\r\\n\\r\\n{0}",
"PopupControl_NoDefaultProperty":"No default property supported for control \"{0}\" of type \"{1}\"",
"RTE_Normal":"Normal",
"PopupExtender_NoParentElement":"Couldn\u0027t find parent element \"{0}\"",
"RTE_ViewValues":"View Values",
"RTE_Legend":"Legend",
"RTE_Labels":"Labels",
"RTE_CellSpacing":"Cell Spacing",
"PasswordStrength_RemainingNumbers":"{0} more numbers",
"RTE_Border":"Border",
"RTE_Create":"Create",
"RTE_BackgroundColor":"Background Color",
"RTE_Cancel":"Cancel",
"RTE_JustifyFull":"Justify Full",
"RTE_JustifyLeft":"Justify Left",
"RTE_Cut":"Cut",
"ResizableControlBehavior_CannotChangeProperty":"Changes to {0} not supported",
"RTE_ViewSource":"View Source",
"Common_InvalidPaddingUnit":"A unit type of \"{0}\" is invalid for parsePadding",
"RTE_Paste":"Paste",
"ExtenderBase_ControlNotRegisteredForCallbacks":"This Control has not been registered for callbacks",
"Calendar_Today":"Today: {0}",
"Common_DateTime_InvalidFormat":"Invalid format",
"ListSearch_DefaultPrompt":"Type to search",
"CollapsiblePanel_NoControlID":"Failed to find element \"{0}\"",
"RTE_ViewEditor":"View Editor",
"RTE_BarColor":"Bar Color",
"PasswordStrength_DefaultStrengthDescriptions":"NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!",
"RTE_Inserttexthere":"Insert text here",
"Animation_UknownAnimationName":"AjaxControlToolkit.Animation.createAnimation could not find an Animation corresponding to the name \"{0}\"",
"ExtenderBase_InvalidClientStateType":"saveClientState must return a value of type String",
"Rating_CallbackError":"An unhandled exception has occurred:\\r\\n{0}",
"Tabs_OwnerExpected":"owner must be set before initialize",
"DynamicPopulate_WebServiceTimeout":"Web service call timed out",
"PasswordStrength_RemainingLowerCase":"{0} more lower case characters",
"Animation_MissingAnimationName":"AjaxControlToolkit.Animation.createAnimation requires an object with an AnimationName property",
"RTE_JustifyRight":"Justify Right",
"Tabs_ActiveTabArgumentOutOfRange":"Argument is not a member of the tabs collection",
"RTE_CellPadding":"Cell Padding",
"RTE_ClearFormatting":"Clear Formatting",
"AlwaysVisible_ElementRequired":"AjaxControlToolkit.AlwaysVisibleControlBehavior must have an element",
"Slider_NoSizeProvided":"Please set valid values for the height and width attributes in the slider\u0027s CSS classes",
"DynamicPopulate_WebServiceError":"Web Service call failed: {0}",
"PasswordStrength_StrengthPrompt":"Strength: ",
"PasswordStrength_RemainingCharacters":"{0} more characters",
"PasswordStrength_Satisfied":"Nothing more required",
"RTE_Hyperlink":"Hyperlink",
"Animation_NoPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\"",
"PasswordStrength_InvalidStrengthDescriptionStyles":"Text Strength description style classes must match the number of text descriptions.",
"PasswordStrength_GetHelpRequirements":"Get help on password requirements",
"PasswordStrength_InvalidStrengthDescriptions":"Invalid number of text strength descriptions specified",
"RTE_Underline":"Underline",
"Tabs_PropertySetAfterInitialization":"{0} cannot be changed after initialization",
"RTE_Rows":"Rows",
"RTE_Redo":"Redo",
"RTE_Size":"Size",
"RTE_Undo":"Undo",
"RTE_Bold":"Bold",
"RTE_Copy":"Copy",
"RTE_Font":"Font",
"CascadingDropDown_MethodError":"[Method error {0}]",
"RTE_BorderColor":"Border Color",
"RTE_Paragraph":"Paragraph",
"RTE_InsertHorizontalRule":"Insert Horizontal Rule",
"Common_UnitHasNoDigits":"No digits",
"RTE_Outdent":"Outdent",
"Common_DateTime_InvalidTimeSpan":"\"{0}\" is not a valid TimeSpan format",
"Animation_CannotNestSequence":"AjaxControlToolkit.Animation.SequenceAnimation cannot be nested inside AjaxControlToolkit.Animation.ParallelAnimation",
"Shared_BrowserSecurityPreventsPaste":"Your browser security settings don\u0027t permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."
};

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit.BoxSide = function() {
}
AjaxControlToolkit.BoxSide.prototype = {
Top : 0,
Right : 1,
Bottom : 2,
Left : 3
}
AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide", false);AjaxControlToolkit._CommonToolkitScripts = function() {
}
AjaxControlToolkit._CommonToolkitScripts.prototype = {
_borderStyleNames : ["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],
_borderWidthNames : ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
_paddingWidthNames : ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
_marginWidthNames : ["marginTop", "marginRight", "marginBottom", "marginLeft"],
getCurrentStyle : function(element, attribute, defaultValue) {
var currentValue = null;if (element) {
if (element.currentStyle) {
currentValue = element.currentStyle[attribute];} else if (document.defaultView && document.defaultView.getComputedStyle) {
var style = document.defaultView.getComputedStyle(element, null);if (style) {
currentValue = style[attribute];}
}
if (!currentValue && element.style.getPropertyValue) {
currentValue = element.style.getPropertyValue(attribute);}
else if (!currentValue && element.style.getAttribute) {
currentValue = element.style.getAttribute(attribute);} 
}
if ((!currentValue || currentValue == "" || typeof(currentValue) === 'undefined')) {
if (typeof(defaultValue) != 'undefined') {
currentValue = defaultValue;}
else {
currentValue = null;}
} 
return currentValue;},
getInheritedBackgroundColor : function(element) {
if (!element) return '#FFFFFF';var background = this.getCurrentStyle(element, 'backgroundColor');try {
while (!background || background == '' || background == 'transparent' || background == 'rgba(0, 0, 0, 0)') {
element = element.parentNode;if (!element) {
background = '#FFFFFF';} else {
background = this.getCurrentStyle(element, 'backgroundColor');}
}
} catch(ex) {
background = '#FFFFFF';}
return background;},
getLocation : function(element) {
if (element === document.documentElement) {
return new Sys.UI.Point(0,0);}
if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) {
if (element.window === element || element.nodeType === 9 || !element.getClientRects || !element.getBoundingClientRect) return new Sys.UI.Point(0,0);var screenRects = element.getClientRects();if (!screenRects || !screenRects.length) {
return new Sys.UI.Point(0,0);}
var first = screenRects[0];var dLeft = 0;var dTop = 0;var inFrame = false;try {
inFrame = element.ownerDocument.parentWindow.frameElement;} catch(ex) {
inFrame = true;}
if (inFrame) {
var clientRect = element.getBoundingClientRect();if (!clientRect) {
return new Sys.UI.Point(0,0);}
var minLeft = first.left;var minTop = first.top;for (var i = 1;i < screenRects.length;i++) {
var r = screenRects[i];if (r.left < minLeft) {
minLeft = r.left;}
if (r.top < minTop) {
minTop = r.top;}
}
dLeft = minLeft - clientRect.left;dTop = minTop - clientRect.top;}
var ownerDocument = element.document.documentElement;return new Sys.UI.Point(first.left - 2 - dLeft + ownerDocument.scrollLeft, first.top - 2 - dTop + ownerDocument.scrollTop);}
return Sys.UI.DomElement.getLocation(element);},
setLocation : function(element, point) {
Sys.UI.DomElement.setLocation(element, point.x, point.y);},
getContentSize : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var size = this.getSize(element);var borderBox = this.getBorderBox(element);var paddingBox = this.getPaddingBox(element);return {
width : size.width - borderBox.horizontal - paddingBox.horizontal,
height : size.height - borderBox.vertical - paddingBox.vertical
}
},
getSize : function(element) {
if (!element) {
throw Error.argumentNull('element');}
return {
width: element.offsetWidth,
height: element.offsetHeight
};},
setContentSize : function(element, size) {
if (!element) {
throw Error.argumentNull('element');}
if (!size) {
throw Error.argumentNull('size');}
if(this.getCurrentStyle(element, 'MozBoxSizing') == 'border-box' || this.getCurrentStyle(element, 'BoxSizing') == 'border-box') {
var borderBox = this.getBorderBox(element);var paddingBox = this.getPaddingBox(element);size = {
width: size.width + borderBox.horizontal + paddingBox.horizontal,
height: size.height + borderBox.vertical + paddingBox.vertical
};}
element.style.width = size.width.toString() + 'px';element.style.height = size.height.toString() + 'px';},
setSize : function(element, size) {
if (!element) {
throw Error.argumentNull('element');}
if (!size) {
throw Error.argumentNull('size');}
var borderBox = this.getBorderBox(element);var paddingBox = this.getPaddingBox(element);var contentSize = {
width: size.width - borderBox.horizontal - paddingBox.horizontal,
height: size.height - borderBox.vertical - paddingBox.vertical
};this.setContentSize(element, contentSize);},
getBounds : function(element) {
var offset = $common.getLocation(element);return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);}, 
setBounds : function(element, bounds) {
if (!element) {
throw Error.argumentNull('element');}
if (!bounds) {
throw Error.argumentNull('bounds');}
this.setSize(element, bounds);$common.setLocation(element, bounds);},
getClientBounds : function() {
var clientWidth;var clientHeight;switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
clientWidth = document.documentElement.clientWidth;clientHeight = document.documentElement.clientHeight;break;case Sys.Browser.Safari:
clientWidth = window.innerWidth;clientHeight = window.innerHeight;break;case Sys.Browser.Opera:
clientWidth = Math.min(window.innerWidth, document.body.clientWidth);clientHeight = Math.min(window.innerHeight, document.body.clientHeight);break;default: 
clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);break;}
return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);},
getMarginBox : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var box = {
top: this.getMargin(element, AjaxControlToolkit.BoxSide.Top),
right: this.getMargin(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getMargin(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getMargin(element, AjaxControlToolkit.BoxSide.Left)
};box.horizontal = box.left + box.right;box.vertical = box.top + box.bottom;return box;},
getBorderBox : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var box = {
top: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Top),
right: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Left)
};box.horizontal = box.left + box.right;box.vertical = box.top + box.bottom;return box;},
getPaddingBox : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var box = {
top: this.getPadding(element, AjaxControlToolkit.BoxSide.Top),
right: this.getPadding(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getPadding(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getPadding(element, AjaxControlToolkit.BoxSide.Left)
};box.horizontal = box.left + box.right;box.vertical = box.top + box.bottom;return box;},
isBorderVisible : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
var styleName = this._borderStyleNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);return styleValue != "none";},
getMargin : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
var styleName = this._marginWidthNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);try { return this.parsePadding(styleValue);} catch(ex) { return 0;}
},
getBorderWidth : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
if(!this.isBorderVisible(element, boxSide)) {
return 0;} 
var styleName = this._borderWidthNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);return this.parseBorderWidth(styleValue);},
getPadding : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
var styleName = this._paddingWidthNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);return this.parsePadding(styleValue);},
parseBorderWidth : function(borderWidth) {
if (!this._borderThicknesses) {
var borderThicknesses = { };var div0 = document.createElement('div');div0.style.visibility = 'hidden';div0.style.position = 'absolute';div0.style.fontSize = '1px';document.body.appendChild(div0)
var div1 = document.createElement('div');div1.style.height = '0px';div1.style.overflow = 'hidden';div0.appendChild(div1);var base = div0.offsetHeight;div1.style.borderTop = 'solid black';div1.style.borderTopWidth = 'thin';borderThicknesses['thin'] = div0.offsetHeight - base;div1.style.borderTopWidth = 'medium';borderThicknesses['medium'] = div0.offsetHeight - base;div1.style.borderTopWidth = 'thick';borderThicknesses['thick'] = div0.offsetHeight - base;div0.removeChild(div1);document.body.removeChild(div0);this._borderThicknesses = borderThicknesses;}
if (borderWidth) {
switch(borderWidth) {
case 'thin':
case 'medium':
case 'thick':
return this._borderThicknesses[borderWidth];case 'inherit':
return 0;}
var unit = this.parseUnit(borderWidth);Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit, unit.type));return unit.size;}
return 0;},
parsePadding : function(padding) {
if(padding) {
if(padding == 'inherit') {
return 0;}
var unit = this.parseUnit(padding);Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit, unit.type));return unit.size;}
return 0;},
parseUnit : function(value) {
if (!value) {
throw Error.argumentNull('value');}
value = value.trim().toLowerCase();var l = value.length;var s = -1;for(var i = 0;i < l;i++) {
var ch = value.substr(i, 1);if((ch < '0' || ch > '9') && ch != '-' && ch != '.' && ch != ',') {
break;}
s = i;}
if(s == -1) {
throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);}
var type;var size;if(s < (l - 1)) {
type = value.substring(s + 1).trim();} else {
type = 'px';}
size = parseFloat(value.substr(0, s + 1));if(type == 'px') {
size = Math.floor(size);}
return { 
size: size,
type: type
};},
getElementOpacity : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var hasOpacity = false;var opacity;if (element.filters) {
var filters = element.filters;if (filters.length !== 0) {
var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];if (alphaFilter) {
opacity = alphaFilter.opacity / 100.0;hasOpacity = true;}
}
}
else {
opacity = this.getCurrentStyle(element, 'opacity', 1);hasOpacity = true;}
if (hasOpacity === false) {
return 1.0;}
return parseFloat(opacity);},
setElementOpacity : function(element, value) {
if (!element) {
throw Error.argumentNull('element');}
if (element.filters) {
var filters = element.filters;var createFilter = true;if (filters.length !== 0) {
var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];if (alphaFilter) {
createFilter = false;alphaFilter.opacity = value * 100;}
}
if (createFilter) {
element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';}
}
else {
element.style.opacity = value;}
},
getVisible : function(element) {
return (element &&
("none" != $common.getCurrentStyle(element, "display")) &&
("hidden" != $common.getCurrentStyle(element, "visibility")));},
setVisible : function(element, value) {
if (element && value != $common.getVisible(element)) {
if (value) {
if (element.style.removeAttribute) {
element.style.removeAttribute("display");} else {
element.style.removeProperty("display");}
} else {
element.style.display = 'none';}
element.style.visibility = value ? 'visible' : 'hidden';}
},
resolveFunction : function(value) {
if (value) {
if (value instanceof Function) {
return value;} else if (String.isInstanceOfType(value) && value.length > 0) {
var func;if ((func = window[value]) instanceof Function) {
return func;} else if ((func = eval(value)) instanceof Function) {
return func;}
}
}
return null;},
addCssClasses : function(element, classNames) {
for(var i = 0;i < classNames.length;i++) {
Sys.UI.DomElement.addCssClass(element, classNames[i]);}
},
removeCssClasses : function(element, classNames) {
for(var i = 0;i < classNames.length;i++) {
Sys.UI.DomElement.removeCssClass(element, classNames[i]);}
},
setStyle : function(element, style) {
$common.applyProperties(element.style, style);},
removeHandlers : function(element, events) {
for (var name in events) {
$removeHandler(element, name, events[name]);}
},
overlaps : function(r1, r2) {
return r1.x < (r2.x + r2.width)
&& r2.x < (r1.x + r1.width)
&& r1.y < (r2.y + r2.height)
&& r2.y < (r1.y + r1.height);},
containsPoint : function(rect, x, y) {
return x >= rect.x && x < (rect.x + rect.width) && y >= rect.y && y < (rect.y + rect.height);},
isKeyDigit : function(keyCode) { 
return (0x30 <= keyCode && keyCode <= 0x39);},
isKeyNavigation : function(keyCode) { 
return (Sys.UI.Key.left <= keyCode && keyCode <= Sys.UI.Key.down);},
padLeft : function(text, size, ch, truncate) { 
return $common._pad(text, size || 2, ch || ' ', 'l', truncate || false);},
padRight : function(text, size, ch, truncate) { 
return $common._pad(text, size || 2, ch || ' ', 'r', truncate || false);},
_pad : function(text, size, ch, side, truncate) {
text = text.toString();var length = text.length;var builder = new Sys.StringBuilder();if (side == 'r') {
builder.append(text);} 
while (length < size) {
builder.append(ch);length++;}
if (side == 'l') {
builder.append(text);}
var result = builder.toString();if (truncate && result.length > size) {
if (side == 'l') {
result = result.substr(result.length - size, size);} else {
result = result.substr(0, size);}
}
return result;},
__DOMEvents : {
focusin : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focusin", true, false, window, 1);} },
focusout : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focusout", true, false, window, 1);} },
activate : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("activate", true, true, window, 1);} },
focus : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focus", false, false, window, 1);} },
blur : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("blur", false, false, window, 1);} },
click : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("click", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
dblclick : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("click", true, true, window, 2, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mousedown : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousedown", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mouseup : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mouseup", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mouseover : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mouseover", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mousemove : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mouseout : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
load : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("load", false, false);} },
unload : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("unload", false, false);} },
select : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("select", true, false);} },
change : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("change", true, false);} },
submit : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("submit", true, true);} },
reset : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("reset", true, false);} },
resize : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("resize", true, false);} },
scroll : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("scroll", true, false);} }
},
tryFireRawEvent : function(element, rawEvent) {
try {
if (element.fireEvent) {
element.fireEvent("on" + rawEvent.type, rawEvent);return true;} else if (element.dispatchEvent) {
element.dispatchEvent(rawEvent);return true;}
} catch (e) {
}
return false;}, 
tryFireEvent : function(element, eventName, properties) {
try {
if (document.createEventObject) {
var e = document.createEventObject();$common.applyProperties(e, properties || {});element.fireEvent("on" + eventName, e);return true;} else if (document.createEvent) {
var def = $common.__DOMEvents[eventName];if (def) {
var e = document.createEvent(def.eventGroup);def.init(e, properties || {});element.dispatchEvent(e);return true;}
}
} catch (e) {
}
return false;},
wrapElement : function(innerElement, newOuterElement, newInnerParentElement) {
var parent = innerElement.parentNode;parent.replaceChild(newOuterElement, innerElement);(newInnerParentElement || newOuterElement).appendChild(innerElement);},
unwrapElement : function(innerElement, oldOuterElement) {
var parent = oldOuterElement.parentNode;if (parent != null) {
$common.removeElement(innerElement);parent.replaceChild(innerElement, oldOuterElement);}
},
removeElement : function(element) {
var parent = element.parentNode;if (parent != null) {
parent.removeChild(element);}
},
applyProperties : function(target, properties) {
for (var p in properties) {
var pv = properties[p];if (pv != null && Object.getType(pv)===Object) {
var tv = target[p];$common.applyProperties(tv, pv);} else {
target[p] = pv;}
}
},
createElementFromTemplate : function(template, appendToParent, nameTable) {
if (typeof(template.nameTable)!='undefined') {
var newNameTable = template.nameTable;if (String.isInstanceOfType(newNameTable)) {
newNameTable = nameTable[newNameTable];}
if (newNameTable != null) {
nameTable = newNameTable;}
}
var elementName = null;if (typeof(template.name)!=='undefined') {
elementName = template.name;}
var elt = document.createElement(template.nodeName);if (typeof(template.name)!=='undefined' && nameTable) {
nameTable[template.name] = elt;}
if (typeof(template.parent)!=='undefined' && appendToParent == null) {
var newParent = template.parent;if (String.isInstanceOfType(newParent)) {
newParent = nameTable[newParent];}
if (newParent != null) {
appendToParent = newParent;}
}
if (typeof(template.properties)!=='undefined' && template.properties != null) {
$common.applyProperties(elt, template.properties);}
if (typeof(template.cssClasses)!=='undefined' && template.cssClasses != null) {
$common.addCssClasses(elt, template.cssClasses);}
if (typeof(template.events)!=='undefined' && template.events != null) {
$addHandlers(elt, template.events);}
if (typeof(template.visible)!=='undefined' && template.visible != null) {
this.setVisible(elt, template.visible);}
if (appendToParent) {
appendToParent.appendChild(elt);}
if (typeof(template.opacity)!=='undefined' && template.opacity != null) {
$common.setElementOpacity(elt, template.opacity);}
if (typeof(template.children)!=='undefined' && template.children != null) {
for (var i = 0;i < template.children.length;i++) {
var subtemplate = template.children[i];$common.createElementFromTemplate(subtemplate, elt, nameTable);}
}
var contentPresenter = elt;if (typeof(template.contentPresenter)!=='undefined' && template.contentPresenter != null) {
contentPresenter = nameTable[contentPresenter];}
if (typeof(template.content)!=='undefined' && template.content != null) {
var content = template.content;if (String.isInstanceOfType(content)) {
content = nameTable[content];}
if (content.parentNode) {
$common.wrapElement(content, elt, contentPresenter);} else {
contentPresenter.appendChild(content);}
}
return elt;},
prepareHiddenElementForATDeviceUpdate : function () {
var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');if (!objHidden) {
var objHidden = document.createElement('input');objHidden.setAttribute('type', 'hidden');objHidden.setAttribute('value', '1');objHidden.setAttribute('id', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');objHidden.setAttribute('name', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');if ( document.forms[0] ) {
document.forms[0].appendChild(objHidden);}
}
},
updateFormToRefreshATDeviceBuffer : function () {
var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');if (objHidden) {
if (objHidden.getAttribute('value') == '1') {
objHidden.setAttribute('value', '0');} else {
objHidden.setAttribute('value', '1');}
}
}
}
var CommonToolkitScripts = AjaxControlToolkit.CommonToolkitScripts = new AjaxControlToolkit._CommonToolkitScripts();var $common = CommonToolkitScripts;Sys.UI.DomElement.getVisible = $common.getVisible;Sys.UI.DomElement.setVisible = $common.setVisible;Sys.UI.Control.overlaps = $common.overlaps;AjaxControlToolkit._DomUtility = function() {
}
AjaxControlToolkit._DomUtility.prototype = {
isDescendant : function(ancestor, descendant) {
for (var n = descendant.parentNode;n != null;n = n.parentNode) {
if (n == ancestor) return true;}
return false;},
isDescendantOrSelf : function(ancestor, descendant) {
if (ancestor === descendant) 
return true;return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);},
isAncestor : function(descendant, ancestor) {
return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);},
isAncestorOrSelf : function(descendant, ancestor) {
if (descendant === ancestor)
return true;return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);},
isSibling : function(self, sibling) {
var parent = self.parentNode;for (var i = 0;i < parent.childNodes.length;i++) {
if (parent.childNodes[i] == sibling) return true;}
return false;}
}
AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");AjaxControlToolkit.DomUtility = new AjaxControlToolkit._DomUtility();AjaxControlToolkit.TextBoxWrapper = function(element) {
AjaxControlToolkit.TextBoxWrapper.initializeBase(this, [element]);this._current = element.value;this._watermark = null;this._isWatermarked = false;}
AjaxControlToolkit.TextBoxWrapper.prototype = {
dispose : function() {
this.get_element().AjaxControlToolkitTextBoxWrapper = null;AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this, 'dispose');},
get_Current : function() {
this._current = this.get_element().value;return this._current;},
set_Current : function(value) {
this._current = value;this._updateElement();},
get_Value : function() {
if (this.get_IsWatermarked()) {
return "";} else {
return this.get_Current();}
},
set_Value : function(text) {
this.set_Current(text);if (!text || (0 == text.length)) {
if (null != this._watermark) {
this.set_IsWatermarked(true);}
} else {
this.set_IsWatermarked(false);}
},
get_Watermark : function() {
return this._watermark;},
set_Watermark : function(value) {
this._watermark = value;this._updateElement();},
get_IsWatermarked : function() {
return this._isWatermarked;},
set_IsWatermarked : function(isWatermarked) {
if (this._isWatermarked != isWatermarked) {
this._isWatermarked = isWatermarked;this._updateElement();this._raiseWatermarkChanged();}
},
_updateElement : function() {
var element = this.get_element();if (this._isWatermarked) {
if (element.value != this._watermark) {
element.value = this._watermark;}
} else {
if (element.value != this._current) {
element.value = this._current;}
}
},
add_WatermarkChanged : function(handler) {
this.get_events().addHandler("WatermarkChanged", handler);},
remove_WatermarkChanged : function(handler) {
this.get_events().removeHandler("WatermarkChanged", handler);},
_raiseWatermarkChanged : function() {
var onWatermarkChangedHandler = this.get_events().getHandler("WatermarkChanged");if (onWatermarkChangedHandler) {
onWatermarkChangedHandler(this, Sys.EventArgs.Empty);}
}
}
AjaxControlToolkit.TextBoxWrapper.get_Wrapper = function(element) {
if (null == element.AjaxControlToolkitTextBoxWrapper) {
element.AjaxControlToolkitTextBoxWrapper = new AjaxControlToolkit.TextBoxWrapper(element);}
return element.AjaxControlToolkitTextBoxWrapper;}
AjaxControlToolkit.TextBoxWrapper.registerClass('AjaxControlToolkit.TextBoxWrapper', Sys.UI.Behavior);AjaxControlToolkit.TextBoxWrapper.validatorGetValue = function(id) {
var control = $get(id);if (control && control.AjaxControlToolkitTextBoxWrapper) {
return control.AjaxControlToolkitTextBoxWrapper.get_Value();}
return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(id);}
if (typeof(ValidatorGetValue) == 'function') {
AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue = ValidatorGetValue;ValidatorGetValue = AjaxControlToolkit.TextBoxWrapper.validatorGetValue;}
if (Sys.CultureInfo.prototype._getAbbrMonthIndex) {
try {
Sys.CultureInfo.prototype._getAbbrMonthIndex('');} catch(ex) {
Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) {
if (!this._upperAbbrMonths) {
this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);}
return Array.indexOf(this._upperAbbrMonths, this._toUpper(value));}
Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;}
}

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
/////////////////////////////////////////////////////////////////////////////
Sys.Timer = function() {
Sys.Timer.initializeBase(this);this._interval = 1000;this._enabled = false;this._timer = null;}
Sys.Timer.prototype = {
get_interval: function() {
return this._interval;},
set_interval: function(value) {
if (this._interval !== value) {
this._interval = value;this.raisePropertyChanged('interval');if (!this.get_isUpdating() && (this._timer !== null)) {
this._stopTimer();this._startTimer();}
}
},
get_enabled: function() {
return this._enabled;},
set_enabled: function(value) {
if (value !== this.get_enabled()) {
this._enabled = value;this.raisePropertyChanged('enabled');if (!this.get_isUpdating()) {
if (value) {
this._startTimer();}
else {
this._stopTimer();}
}
}
},
add_tick: function(handler) {
this.get_events().addHandler("tick", handler);},
remove_tick: function(handler) {
this.get_events().removeHandler("tick", handler);},
dispose: function() {
this.set_enabled(false);this._stopTimer();Sys.Timer.callBaseMethod(this, 'dispose');},
updated: function() {
Sys.Timer.callBaseMethod(this, 'updated');if (this._enabled) {
this._stopTimer();this._startTimer();}
},
_timerCallback: function() {
var handler = this.get_events().getHandler("tick");if (handler) {
handler(this, Sys.EventArgs.Empty);}
},
_startTimer: function() {
this._timer = window.setInterval(Function.createDelegate(this, this._timerCallback), this._interval);},
_stopTimer: function() {
window.clearInterval(this._timer);this._timer = null;}
}
Sys.Timer.descriptor = {
properties: [ {name: 'interval', type: Number},
{name: 'enabled', type: Boolean} ],
events: [ {name: 'tick'} ]
}
Sys.Timer.registerClass('Sys.Timer', Sys.Component);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
/////////////////////////////////////////////////////////////////////////////
Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit.IDragSource = function() {
}
AjaxControlToolkit.IDragSource.prototype = {
get_dragDataType: function() { throw Error.notImplemented();},
getDragData: function() { throw Error.notImplemented();},
get_dragMode: function() { throw Error.notImplemented();},
onDragStart: function() { throw Error.notImplemented();},
onDrag: function() { throw Error.notImplemented();},
onDragEnd: function() { throw Error.notImplemented();}
}
AjaxControlToolkit.IDragSource.registerInterface('AjaxControlToolkit.IDragSource');/////////////////////////////////////////////////////////////////////////////
AjaxControlToolkit.IDropTarget = function() {
}
AjaxControlToolkit.IDropTarget.prototype = {
get_dropTargetElement: function() { throw Error.notImplemented();},
canDrop: function() { throw Error.notImplemented();},
drop: function() { throw Error.notImplemented();},
onDragEnterTarget: function() { throw Error.notImplemented();},
onDragLeaveTarget: function() { throw Error.notImplemented();},
onDragInTarget: function() { throw Error.notImplemented();}
}
AjaxControlToolkit.IDropTarget.registerInterface('AjaxControlToolkit.IDropTarget');/////////////////////////////////////////////
AjaxControlToolkit.DragMode = function() {
throw Error.invalidOperation();}
AjaxControlToolkit.DragMode.prototype = {
Copy: 0,
Move: 1
}
AjaxControlToolkit.DragMode.registerEnum('AjaxControlToolkit.DragMode');//////////////////////////////////////////////////////////////////
AjaxControlToolkit.DragDropEventArgs = function(dragMode, dragDataType, dragData) {
this._dragMode = dragMode;this._dataType = dragDataType;this._data = dragData;}
AjaxControlToolkit.DragDropEventArgs.prototype = {
get_dragMode: function() {
return this._dragMode || null;},
get_dragDataType: function() {
return this._dataType || null;},
get_dragData: function() {
return this._data || null;}
}
AjaxControlToolkit.DragDropEventArgs.registerClass('AjaxControlToolkit.DragDropEventArgs');AjaxControlToolkit._DragDropManager = function() {
this._instance = null;this._events = null;}
AjaxControlToolkit._DragDropManager.prototype = {
add_dragStart: function(handler) {
this.get_events().addHandler('dragStart', handler);},
remove_dragStart: function(handler) {
this.get_events().removeHandler('dragStart', handler);},
get_events: function() {
if (!this._events) {
this._events = new Sys.EventHandlerList();}
return this._events;},
add_dragStop: function(handler) {
this.get_events().addHandler('dragStop', handler);},
remove_dragStop: function(handler) {
this.get_events().removeHandler('dragStop', handler);},
_getInstance: function() {
if (!this._instance) {
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
this._instance = new AjaxControlToolkit.IEDragDropManager();}
else {
this._instance = new AjaxControlToolkit.GenericDragDropManager();}
this._instance.initialize();this._instance.add_dragStart(Function.createDelegate(this, this._raiseDragStart));this._instance.add_dragStop(Function.createDelegate(this, this._raiseDragStop));}
return this._instance;},
startDragDrop: function(dragSource, dragVisual, context) {
this._getInstance().startDragDrop(dragSource, dragVisual, context);},
registerDropTarget: function(target) {
this._getInstance().registerDropTarget(target);},
unregisterDropTarget: function(target) {
this._getInstance().unregisterDropTarget(target);},
dispose: function() {
delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this);},
_raiseDragStart: function(sender, eventArgs) {
var handler = this.get_events().getHandler('dragStart');if(handler) {
handler(this, eventArgs);}
},
_raiseDragStop: function(sender, eventArgs) {
var handler = this.get_events().getHandler('dragStop');if(handler) {
handler(this, eventArgs);}
}
}
AjaxControlToolkit._DragDropManager.registerClass('AjaxControlToolkit._DragDropManager');AjaxControlToolkit.DragDropManager = new AjaxControlToolkit._DragDropManager();AjaxControlToolkit.IEDragDropManager = function() {
AjaxControlToolkit.IEDragDropManager.initializeBase(this);this._dropTargets = null;this._radius = 10;this._activeDragVisual = null;this._activeContext = null;this._activeDragSource = null;this._underlyingTarget = null;this._oldOffset = null;this._potentialTarget = null;this._isDragging = false;this._mouseUpHandler = null;this._documentMouseMoveHandler = null;this._documentDragOverHandler = null;this._dragStartHandler = null;this._mouseMoveHandler = null;this._dragEnterHandler = null;this._dragLeaveHandler = null;this._dragOverHandler = null;this._dropHandler = null;}
AjaxControlToolkit.IEDragDropManager.prototype = {
add_dragStart : function(handler) {
this.get_events().addHandler("dragStart", handler);},
remove_dragStart : function(handler) {
this.get_events().removeHandler("dragStart", handler);},
add_dragStop : function(handler) {
this.get_events().addHandler("dragStop", handler);},
remove_dragStop : function(handler) {
this.get_events().removeHandler("dragStop", handler);},
initialize : function() {
AjaxControlToolkit.IEDragDropManager.callBaseMethod(this, 'initialize');this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp);this._documentMouseMoveHandler = Function.createDelegate(this, this._onDocumentMouseMove);this._documentDragOverHandler = Function.createDelegate(this, this._onDocumentDragOver);this._dragStartHandler = Function.createDelegate(this, this._onDragStart);this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove);this._dragEnterHandler = Function.createDelegate(this, this._onDragEnter);this._dragLeaveHandler = Function.createDelegate(this, this._onDragLeave);this._dragOverHandler = Function.createDelegate(this, this._onDragOver);this._dropHandler = Function.createDelegate(this, this._onDrop);},
dispose : function() {
if(this._dropTargets) {
for (var i = 0;i < this._dropTargets;i++) {
this.unregisterDropTarget(this._dropTargets[i]);}
this._dropTargets = null;}
AjaxControlToolkit.IEDragDropManager.callBaseMethod(this, 'dispose');},
startDragDrop : function(dragSource, dragVisual, context) {
var ev = window._event;if (this._isDragging) {
return;}
this._underlyingTarget = null;this._activeDragSource = dragSource;this._activeDragVisual = dragVisual;this._activeContext = context;var mousePosition = { x: ev.clientX, y: ev.clientY };dragVisual.originalPosition = dragVisual.style.position;dragVisual.style.position = "absolute";document._lastPosition = mousePosition;dragVisual.startingPoint = mousePosition;var scrollOffset = this.getScrollOffset(dragVisual,  true);dragVisual.startingPoint = this.addPoints(dragVisual.startingPoint, scrollOffset);if (dragVisual.style.position == "absolute") {
dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, $common.getLocation(dragVisual));}
else {
var left = parseInt(dragVisual.style.left);var top = parseInt(dragVisual.style.top);if (isNaN(left)) left = "0";if (isNaN(top)) top = "0";dragVisual.startingPoint = this.subtractPoints(dragVisual.startingPoint, { x: left, y: top });}
this._prepareForDomChanges();dragSource.onDragStart();var eventArgs = new AjaxControlToolkit.DragDropEventArgs(
dragSource.get_dragMode(),
dragSource.get_dragDataType(),
dragSource.getDragData(context));var handler = this.get_events().getHandler('dragStart');if(handler) handler(this,eventArgs);this._recoverFromDomChanges();this._wireEvents();this._drag( true);},
_stopDragDrop : function(cancelled) {
var ev = window._event;if (this._activeDragSource != null) {
this._unwireEvents();if (!cancelled) {
cancelled = (this._underlyingTarget == null);}
if (!cancelled && this._underlyingTarget != null) {
this._underlyingTarget.drop(this._activeDragSource.get_dragMode(), this._activeDragSource.get_dragDataType(),
this._activeDragSource.getDragData(this._activeContext));}
this._activeDragSource.onDragEnd(cancelled);var handler = this.get_events().getHandler('dragStop');if(handler) handler(this,Sys.EventArgs.Empty);this._activeDragVisual.style.position = this._activeDragVisual.originalPosition;this._activeDragSource = null;this._activeContext = null;this._activeDragVisual = null;this._isDragging = false;this._potentialTarget = null;ev.preventDefault();}
},
_drag : function(isInitialDrag) {
var ev = window._event;var mousePosition = { x: ev.clientX, y: ev.clientY };document._lastPosition = mousePosition;var scrollOffset = this.getScrollOffset(this._activeDragVisual,  true);var position = this.addPoints(this.subtractPoints(mousePosition, this._activeDragVisual.startingPoint), scrollOffset);if (!isInitialDrag && parseInt(this._activeDragVisual.style.left) == position.x && parseInt(this._activeDragVisual.style.top) == position.y) {
return;}
$common.setLocation(this._activeDragVisual, position);this._prepareForDomChanges();this._activeDragSource.onDrag();this._recoverFromDomChanges();this._potentialTarget = this._findPotentialTarget(this._activeDragSource, this._activeDragVisual);var movedToOtherTarget = (this._potentialTarget != this._underlyingTarget || this._potentialTarget == null);if (movedToOtherTarget && this._underlyingTarget != null) {
this._leaveTarget(this._activeDragSource, this._underlyingTarget);}
if (this._potentialTarget != null) {
if (movedToOtherTarget) {
this._underlyingTarget = this._potentialTarget;this._enterTarget(this._activeDragSource, this._underlyingTarget);}
else {
this._moveInTarget(this._activeDragSource, this._underlyingTarget);}
}
else {
this._underlyingTarget = null;}
},
_wireEvents : function() {
$addHandler(document, "mouseup", this._mouseUpHandler);$addHandler(document, "mousemove", this._documentMouseMoveHandler);$addHandler(document.body, "dragover", this._documentDragOverHandler);$addHandler(this._activeDragVisual, "dragstart", this._dragStartHandler);$addHandler(this._activeDragVisual, "dragend", this._mouseUpHandler);$addHandler(this._activeDragVisual, "drag", this._mouseMoveHandler);},
_unwireEvents : function() {
$removeHandler(this._activeDragVisual, "drag", this._mouseMoveHandler);$removeHandler(this._activeDragVisual, "dragend", this._mouseUpHandler);$removeHandler(this._activeDragVisual, "dragstart", this._dragStartHandler);$removeHandler(document.body, "dragover", this._documentDragOverHandler);$removeHandler(document, "mousemove", this._documentMouseMoveHandler);$removeHandler(document, "mouseup", this._mouseUpHandler);},
registerDropTarget : function(dropTarget) {
if (this._dropTargets == null) {
this._dropTargets = [];}
Array.add(this._dropTargets, dropTarget);this._wireDropTargetEvents(dropTarget);},
unregisterDropTarget : function(dropTarget) {
this._unwireDropTargetEvents(dropTarget);if (this._dropTargets) {
Array.remove(this._dropTargets, dropTarget);}
},
_wireDropTargetEvents : function(dropTarget) {
var associatedElement = dropTarget.get_dropTargetElement();associatedElement._dropTarget = dropTarget;$addHandler(associatedElement, "dragenter", this._dragEnterHandler);$addHandler(associatedElement, "dragleave", this._dragLeaveHandler);$addHandler(associatedElement, "dragover", this._dragOverHandler);$addHandler(associatedElement, "drop", this._dropHandler);},
_unwireDropTargetEvents : function(dropTarget) {
var associatedElement = dropTarget.get_dropTargetElement();if(associatedElement._dropTarget)
{
associatedElement._dropTarget = null;$removeHandler(associatedElement, "dragenter", this._dragEnterHandler);$removeHandler(associatedElement, "dragleave", this._dragLeaveHandler);$removeHandler(associatedElement, "dragover", this._dragOverHandler);$removeHandler(associatedElement, "drop", this._dropHandler);}
},
_onDragStart : function(ev) {
window._event = ev;document.selection.empty();var dt = ev.dataTransfer;if(!dt && ev.rawEvent) dt = ev.rawEvent.dataTransfer;var dataType = this._activeDragSource.get_dragDataType().toLowerCase();var data = this._activeDragSource.getDragData(this._activeContext);if (data) {
if (dataType != "text" && dataType != "url") {
dataType = "text";if (data.innerHTML != null) {
data = data.innerHTML;}
}
dt.effectAllowed = "move";dt.setData(dataType, data.toString());}
},
_onMouseUp : function(ev) {
window._event = ev;this._stopDragDrop(false);},
_onDocumentMouseMove : function(ev) {
window._event = ev;this._dragDrop();},
_onDocumentDragOver : function(ev) {
window._event = ev;if(this._potentialTarget) ev.preventDefault();},
_onMouseMove : function(ev) {
window._event = ev;this._drag();},
_onDragEnter : function(ev) {
window._event = ev;if (this._isDragging) {
ev.preventDefault();}
else {
var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));for (var i = 0;i < dataObjects.length;i++) {
this._dropTarget.onDragEnterTarget(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);}
}
},
_onDragLeave : function(ev) {
window._event = ev;if (this._isDragging) {
ev.preventDefault();}
else {
var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));for (var i = 0;i < dataObjects.length;i++) {
this._dropTarget.onDragLeaveTarget(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);}
}
},
_onDragOver : function(ev) {
window._event = ev;if (this._isDragging) {
ev.preventDefault();}
else {
var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));for (var i = 0;i < dataObjects.length;i++) {
this._dropTarget.onDragInTarget(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);}
}
},
_onDrop : function(ev) {
window._event = ev;if (!this._isDragging) {
var dataObjects = AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(ev.target));for (var i = 0;i < dataObjects.length;i++) {
this._dropTarget.drop(AjaxControlToolkit.DragMode.Copy, dataObjects[i].type, dataObjects[i].value);}
}
ev.preventDefault();},
_getDropTarget : function(element) {
while (element) {
if (element._dropTarget != null) {
return element._dropTarget;}
element = element.parentNode;}
return null;},
_dragDrop : function() {
if (this._isDragging) {
return;}
this._isDragging = true;this._activeDragVisual.dragDrop();document.selection.empty();},
_moveInTarget : function(dragSource, dropTarget) {
this._prepareForDomChanges();dropTarget.onDragInTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext));this._recoverFromDomChanges();},
_enterTarget : function(dragSource, dropTarget) {
this._prepareForDomChanges();dropTarget.onDragEnterTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext));this._recoverFromDomChanges();},
_leaveTarget : function(dragSource, dropTarget) {
this._prepareForDomChanges();dropTarget.onDragLeaveTarget(dragSource.get_dragMode(), dragSource.get_dragDataType(), dragSource.getDragData(this._activeContext));this._recoverFromDomChanges();},
_findPotentialTarget : function(dragSource, dragVisual) {
var ev = window._event;if (this._dropTargets == null) {
return null;}
var type = dragSource.get_dragDataType();var mode = dragSource.get_dragMode();var data = dragSource.getDragData(this._activeContext);var scrollOffset = this.getScrollOffset(document.body,  true);var x = ev.clientX + scrollOffset.x;var y = ev.clientY + scrollOffset.y;var cursorRect = { x: x - this._radius, y: y - this._radius, width: this._radius * 2, height: this._radius * 2 };var targetRect;for (var i = 0;i < this._dropTargets.length;i++) {
targetRect = $common.getBounds(this._dropTargets[i].get_dropTargetElement());if ($common.overlaps(cursorRect, targetRect) && this._dropTargets[i].canDrop(mode, type, data)) {
return this._dropTargets[i];}
}
return null;},
_prepareForDomChanges : function() {
this._oldOffset = $common.getLocation(this._activeDragVisual);},
_recoverFromDomChanges : function() {
var newOffset = $common.getLocation(this._activeDragVisual);if (this._oldOffset.x != newOffset.x || this._oldOffset.y != newOffset.y) {
this._activeDragVisual.startingPoint = this.subtractPoints(this._activeDragVisual.startingPoint, this.subtractPoints(this._oldOffset, newOffset));scrollOffset = this.getScrollOffset(this._activeDragVisual,  true);var position = this.addPoints(this.subtractPoints(document._lastPosition, this._activeDragVisual.startingPoint), scrollOffset);$common.setLocation(this._activeDragVisual, position);}
},
addPoints : function(p1, p2) {
return { x: p1.x + p2.x, y: p1.y + p2.y };},
subtractPoints : function(p1, p2) {
return { x: p1.x - p2.x, y: p1.y - p2.y };},
getScrollOffset : function(element, recursive) {
var left = element.scrollLeft;var top = element.scrollTop;if (recursive) {
var parent = element.parentNode;while (parent != null && parent.scrollLeft != null) {
left += parent.scrollLeft;top += parent.scrollTop;if (parent == document.body && (left != 0 && top != 0))
break;parent = parent.parentNode;}
}
return { x: left, y: top };},
getBrowserRectangle : function() {
var width = window.innerWidth;var height = window.innerHeight;if (width == null) {
width = document.body.clientWidth;}
if (height == null) {
height = document.body.clientHeight;}
return { x: 0, y: 0, width: width, height: height };},
getNextSibling : function(item) {
for (item = item.nextSibling;item != null;item = item.nextSibling) {
if (item.innerHTML != null) {
return item;}
}
return null;},
hasParent : function(element) {
return (element.parentNode != null && element.parentNode.tagName != null);}
}
AjaxControlToolkit.IEDragDropManager.registerClass('AjaxControlToolkit.IEDragDropManager', Sys.Component);AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget = function(dropTarget) {
if (dropTarget == null) {
return [];}
var ev = window._event;var dataObjects = [];var dataTypes = [ "URL", "Text" ];var data;for (var i = 0;i < dataTypes.length;i++) {
var dt = ev.dataTransfer;if(!dt && ev.rawEvent) dt = ev.rawEvent.dataTransfer;data = dt.getData(dataTypes[i]);if (dropTarget.canDrop(AjaxControlToolkit.DragMode.Copy, dataTypes[i], data)) {
if (data) {
Array.add(dataObjects, { type : dataTypes[i], value : data });}
}
}
return dataObjects;}
AjaxControlToolkit.GenericDragDropManager = function() {
AjaxControlToolkit.GenericDragDropManager.initializeBase(this);this._dropTargets = null;this._scrollEdgeConst = 40;this._scrollByConst = 10;this._scroller = null;this._scrollDeltaX = 0;this._scrollDeltaY = 0;this._activeDragVisual = null;this._activeContext = null;this._activeDragSource = null;this._oldOffset = null;this._potentialTarget = null;this._mouseUpHandler = null;this._mouseMoveHandler = null;this._keyPressHandler = null;this._scrollerTickHandler = null;}
AjaxControlToolkit.GenericDragDropManager.prototype = {
initialize : function() {
AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "initialize");this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp);this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove);this._keyPressHandler = Function.createDelegate(this, this._onKeyPress);this._scrollerTickHandler = Function.createDelegate(this, this._onScrollerTick);if (Sys.Browser.agent === Sys.Browser.Safari) {
AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer(this);}
this._scroller = new Sys.Timer();this._scroller.set_interval(10);this._scroller.add_tick(this._scrollerTickHandler);},
startDragDrop : function(dragSource, dragVisual, context) {
this._activeDragSource = dragSource;this._activeDragVisual = dragVisual;this._activeContext = context;AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "startDragDrop", [dragSource, dragVisual, context]);},
_stopDragDrop : function(cancelled) {
this._scroller.set_enabled(false);AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "_stopDragDrop", [cancelled]);},
_drag : function(isInitialDrag) {
AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this, "_drag", [isInitialDrag]);this._autoScroll();},
_wireEvents : function() {
$addHandler(document, "mouseup", this._mouseUpHandler);$addHandler(document, "mousemove", this._mouseMoveHandler);$addHandler(document, "keypress", this._keyPressHandler);},
_unwireEvents : function() {
$removeHandler(document, "keypress", this._keyPressHandler);$removeHandler(document, "mousemove", this._mouseMoveHandler);$removeHandler(document, "mouseup", this._mouseUpHandler);},
_wireDropTargetEvents : function(dropTarget) {
},
_unwireDropTargetEvents : function(dropTarget) {
},
_onMouseUp : function(e) {
window._event = e;this._stopDragDrop(false);},
_onMouseMove : function(e) {
window._event = e;this._drag();},
_onKeyPress : function(e) {
window._event = e;var k = e.keyCode ? e.keyCode : e.rawEvent.keyCode;if (k == 27) {
this._stopDragDrop( true);}
},
_autoScroll : function() {
var ev = window._event;var browserRect = this.getBrowserRectangle();if (browserRect.width > 0) {
this._scrollDeltaX = this._scrollDeltaY = 0;if (ev.clientX < browserRect.x + this._scrollEdgeConst) this._scrollDeltaX = -this._scrollByConst;else if (ev.clientX > browserRect.width - this._scrollEdgeConst) this._scrollDeltaX = this._scrollByConst;if (ev.clientY < browserRect.y + this._scrollEdgeConst) this._scrollDeltaY = -this._scrollByConst;else if (ev.clientY > browserRect.height - this._scrollEdgeConst) this._scrollDeltaY = this._scrollByConst;if (this._scrollDeltaX != 0 || this._scrollDeltaY != 0) {
this._scroller.set_enabled(true);}
else {
this._scroller.set_enabled(false);}
}
},
_onScrollerTick : function() {
var oldLeft = document.body.scrollLeft;var oldTop = document.body.scrollTop;window.scrollBy(this._scrollDeltaX, this._scrollDeltaY);var newLeft = document.body.scrollLeft;var newTop = document.body.scrollTop;var dragVisual = this._activeDragVisual;var position = { x: parseInt(dragVisual.style.left) + (newLeft - oldLeft), y: parseInt(dragVisual.style.top) + (newTop - oldTop) };$common.setLocation(dragVisual, position);}
}
AjaxControlToolkit.GenericDragDropManager.registerClass('AjaxControlToolkit.GenericDragDropManager', AjaxControlToolkit.IEDragDropManager);if (Sys.Browser.agent === Sys.Browser.Safari) {
AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer = function(ddm) {
ddm._getScrollOffset = ddm.getScrollOffset;ddm.getScrollOffset = function(element, recursive) {
return { x: 0, y: 0 };}
ddm._getBrowserRectangle = ddm.getBrowserRectangle;ddm.getBrowserRectangle = function() {
var browserRect = ddm._getBrowserRectangle();var offset = ddm._getScrollOffset(document.body, true);return { x: browserRect.x + offset.x, y: browserRect.y + offset.y,
width: browserRect.width + offset.x, height: browserRect.height + offset.y };}
}
}

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace("Insp");
Type.registerNamespace("Insp.UI");

/////////////////Insp.UI.ModuleCtl//////////////////
Insp.UI.ModuleCtl = function(element)
{
    Insp.UI.ModuleCtl.initializeBase(this,[element]);
    this._showHeader;
    this._showCollapseBtn;
    this._showRefreshBtn;
    this._showCloseBtn;
    this._showEditBtn;
    this._moveable;
    this._moduleID;
    this._updatePanelID;
    this._editSectionID;
    this._contentSectionID;
    this._akamaiUrlPrefix;
    this._akamaiUrlSuffix;
    
    this._minimized;
    this._showEditPart;
    this._moduleTitle;
    
    this._dragBehavior = null;
    this._components = [];
    
    //Delgates
    this._minBtnClickDelegate = null;
    this._editBtnClickDelegate = null;
    this._refreshBtnClickDelegate = null;
    this._closeBtnClickDelegate = null;
    this._propChangedDelegate = null;
}

Insp.UI.ModuleCtl.prototype = {
    get_showHeader: function(){return this._showHeader;},
    set_showHeader: function(value){this._showHeader = value;this.raisePropertyChanged('showHeader');},
    
    get_showCollapseBtn: function(){return this._showCollapseBtn;},
    set_showCollapseBtn: function(value){this._showCollapseBtn = value;this.raisePropertyChanged('showCollapseBtn');},
    
    get_showRefreshBtn: function(){return this._showRefreshBtn;},
    set_showRefreshBtn: function(value){this._showRefreshBtn = value;this.raisePropertyChanged('showRefreshBtn');},
    
    get_showCloseBtn: function(){return this._showCloseBtn;},
    set_showCloseBtn: function(value){this._showCloseBtn = value;this.raisePropertyChanged('showCloseBtn');},
    
    get_showEditBtn: function(){return this._showEditBtn;},
    set_showEditBtn: function(value){this._showEditBtn = value;this.raisePropertyChanged('showEditBtn');},
    
    get_moveable: function(){return this._moveable;},
    set_moveable: function(value){this._moveable = value;this.raisePropertyChanged('moveable');},
    
    get_moduleID: function(){return this._moduleID;},
    set_moduleID: function(value){this._moduleID = value;this.raisePropertyChanged('moduleID');},
    
    get_updatePanelID: function(){return this._updatePanelID;},
    set_updatePanelID: function(value){this._updatePanelID = value;this.raisePropertyChanged('updatePanelID');},
    
    get_editSectionID: function(){return this._editSectionID;},
    set_editSectionID: function(value){this._editSectionID = value;this.raisePropertyChanged('editSectionID');},
    
    get_contentSectionID: function(){return this._contentSectionID;},
    set_contentSectionID: function(value){this._contentSectionID = value;this.raisePropertyChanged('contentSectionID');},
    
    get_akamaiUrlPrefix: function(){return this._akamaiUrlPrefix;},
    set_akamaiUrlPrefix: function(value){this._akamaiUrlPrefix = value;this.raisePropertyChanged('akamaiUrlPrefix');},
    
    get_akamaiUrlSuffix: function(){return this._akamaiUrlSuffix;},
    set_akamaiUrlSuffix: function(value){this._akamaiUrlSuffix = value;this.raisePropertyChanged('akamaiUrlSuffix');},
    
    get_minimized: function(){return this._minimized;},
    set_minimized: function(value){this._minimized = value;this.raisePropertyChanged('minimized');},
    
    get_showEditPart: function(){return this._showEditPart;},
    set_showEditPart: function(value){this._showEditPart = value;this.raisePropertyChanged('showEditPart');},

    get_moduleTitle: function(){return this._moduleTitle;},
    set_moduleTitle: function(value)
    {
        this._moduleTitle = value;this.raisePropertyChanged('moduleTitle');
        this._setTitleInternal(this._moduleTitle);
    },
        
    add_moduleClosing: function(handler){this.get_events().addHandler('moduleClosing',handler);},
    remove_moduleClosing: function(handler){this.get_events().removeHandler('moduleClosing',handler);},    
    
    initialize: function()
    {
        Insp.UI.ModuleCtl.callBaseMethod(this,'initialize');
        
        this._initModuleFromProps();

        if (this._closeBtnClickDelegate === null) {
            this._closeBtnClickDelegate = Function.createDelegate(this, this._closeBtnClickHandler);
        }
        $addHandler($get('CloseBtn',this.get_element()),"click",this._closeBtnClickDelegate);
                
        if (this._minBtnClickDelegate === null) {
            this._minBtnClickDelegate = Function.createDelegate(this, this._minBtnClickHandler);
        }
        $addHandler($get('MinBtn',this.get_element()),"click",this._minBtnClickDelegate);
        
        if (this._editBtnClickDelegate === null) {
            this._editBtnClickDelegate = Function.createDelegate(this, this._editBtnClickHandler);
        }
        $addHandler($get('EditBtn',this.get_element()),"click",this._editBtnClickDelegate);

        if (this._refreshBtnClickDelegate === null) {
            this._refreshBtnClickDelegate = Function.createDelegate(this, this._refreshBtnClickHandler);
        }
        $addHandler($get('RefreshBtn',this.get_element()),"click",this._refreshBtnClickDelegate);
                
        if (this._propChangedDelegate === null) {
            this._propChangedDelegate = Function.createDelegate(this, this._propChangedHandler);
        }
        this.add_propertyChanged(this._propChangedDelegate);
        
        if(Insp && Insp.Behaviors && Insp.Behaviors.DraggableBehavior && this.get_moveable())
        {
            if(typeof($get(this.get_updatePanelID())["DraggableBehavior"]) !== 'undefined'){
                this._dragBehavior = $get(this.get_updatePanelID())["DraggableBehavior"];
                this._dragBehavior.set_handleID("TitleCell");
            }else
                this._dragBehavior = $create(Insp.Behaviors.DraggableBehavior,{name:"DraggableBehavior",handleID:"TitleCell",dragFlavor:"Insp.UI.Module"},null,null,$get(this.get_updatePanelID()));
        }
             
    },
    dispose: function()
    {
        //if(this._dragBehavior)delete this._dragBehavior;
        
        this.remove_propertyChanged(this._propChangedDelegate);
        if (this._propChangedDelegate) delete this._propChangedDelegate;
        
        $removeHandler($get('RefreshBtn',this.get_element()),"click",this._refreshBtnClickDelegate);
        if (this._refreshBtnClickDelegate) delete this._refreshBtnClickDelegate;
        
        $removeHandler($get('MinBtn',this.get_element()),"click",this._minBtnClickDelegate);
        if (this._minBtnClickDelegate) delete this._minBtnClickDelegate;
        
        $removeHandler($get('EditBtn',this.get_element()),"click",this._editBtnClickDelegate);
        if (this._editBtnClickDelegate) delete this._editBtnClickDelegate;
        
        $removeHandler($get('CloseBtn',this.get_element()),"click",this._closeBtnClickDelegate);
        if (this._closeBtnClickDelegate) delete this._closeBtnClickDelegate;
        
        for(var a in this._components)delete this._components[a];
        Insp.UI.ModuleCtl.callBaseMethod(this,'dispose');
    },
    _initModuleFromProps: function()
    {
        var o = $get("HeaderPanel",this.get_element());
        var m = $get('minimizeContainer',this.get_element());
        if(this._showHeader){if(o){o.style.display="";o.visibility="visible";}}
        else{if(o){o.style.display="none";o.visibility="hidden";}m.style.border='none';}
        
        var o = $get("FooterPanel",this.get_element());
        if(this._showHeader){if(o){o.style.display="";o.visibility="visible";}}
        else{if(o){o.style.display="none";o.visibility="hidden";}}
        
        var o = $get("MinBtnCell",this.get_element());
        if(this._showCollapseBtn){if(o){o.style.display="";o.visibility="visible";}}
        else{if(o){o.style.display="none";o.visibility="hidden";}}

        var o = $get("RefreshBtnCell",this.get_element());
        if(this._showRefreshBtn){if(o){o.style.display="";o.visibility="visible";}}
        else{if(o){o.style.display="none";o.visibility="hidden";}}
        
        var o = $get("CloseBtnCell",this.get_element());
        if(this._showCloseBtn){if(o){o.style.display="";o.visibility="visible";}}
        else{if(o){o.style.display="none";o.visibility="hidden";}}
        
        var o = $get("EditBtnCell",this.get_element());
        if(this._showEditBtn){if(o){o.style.display="";o.visibility="visible";}}
        else{if(o){o.style.display="none";o.visibility="hidden";}}
        
        var o = $get("TitleCell",this.get_element());
        if(this._moveable){if(o && !Sys.UI.DomElement.containsCssClass(o,"itemHandle")){Sys.UI.DomElement.addCssClass(o,"itemHandle");}}
        else{if(o)Sys.UI.DomElement.removeCssClass(o,"itemHandle");}
    },
    
    _minMaxModule:function(min)
    {
        var o = $get('minimizeContainer',this.get_element());
        var m = $get('MinBtn',this.get_element());
        var e = $get('EditBtn',this.get_element());
        if(o)
        {   (min)?o.style.display="none":o.style.display="block";
            (min)?o.visibility="hidden":o.visibility="visible";
            if(min){Sys.UI.DomElement.addCssClass(m,"ptModIcnMax");Sys.UI.DomElement.removeCssClass(m,"ptModIcnMin");}
            else{Sys.UI.DomElement.addCssClass(m,"ptModIcnMin");Sys.UI.DomElement.removeCssClass(m,"ptModIcnMax");}
            if(min){
                Sys.UI.DomElement.addCssClass(e,"ptModIcnEdit_disabled");Sys.UI.DomElement.removeCssClass(e,"ptModIcnEdit");
                $removeHandler($get('EditBtn',this.get_element()),"click",this._editBtnClickDelegate);
            }else{
                Sys.UI.DomElement.addCssClass(e,"ptModIcnEdit");Sys.UI.DomElement.removeCssClass(e,"ptModIcnEdit_disabled");
                $addHandler($get('EditBtn',this.get_element()),"click",this._editBtnClickDelegate);
            }
        }
    },
    _hideShowEditPart:function(show)
    {
        var o = $get(this.get_editSectionID(),this.get_element());
        if(o)
        {   (show)?o.style.display="block":o.style.display="none";
            (show)?o.visibility="visible":o.visibility="hidden";
        }
    },
    refreshModule:function()
    {
        var o = $get("RefreshBtn",this.get_element());
        if(o)o.className = "ImgWait";
        __doPostBack(this.get_updatePanelID(),'');
    },
    closeModule:function()
    {
        var f = this.get_events().getHandler('moduleClosing');
        if(f)f(this,args);
        var confirmclose = confirm(strModuleDelete);
        if(confirmclose==true){
            $get(this.get_updatePanelID()).style.display='none';
            WSCall("delete",this.get_updatePanelID(),null,null,null);
            LogClient('903','portalmain');
        }
    },
    _setTitleInternal:function(titleStr)
    {
        var o = $get('HeaderLabel',this.get_element());
        if(o){o.innerHTML=titleStr;o.title=titleStr};
    },
    _propChangedHandler:function(sender,prop)
    {
        if(prop.get_propertyName() == 'minimized')
        {this._minMaxModule(this.get_minimized());}
        else if(prop.get_propertyName() == 'showEditPart')
        {this._hideShowEditPart(this.get_showEditPart());}
    },
    _closeBtnClickHandler: function()
    {
        this.closeModule();
    },
    _minBtnClickHandler:function(evt)
    {
        this.set_minimized(!this.get_minimized());
    },
    _editBtnClickHandler:function(evt)
    {
        this.set_showEditPart(!this.get_showEditPart());
    },
    _refreshBtnClickHandler:function(evt)
    {
        this.refreshModule();
    },
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))this._components[e.get_id()] = e;
    },
    getComponents:function()
    {
        var a=[];b= this._components;
        for(var c in b)a[a.length] = b[c];
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}
Insp.UI.ModuleCtl.registerClass("Insp.UI.ModuleCtl", Sys.UI.Control, Sys.IContainer);

/////////////////Insp.UI.ModuleChildCtl//////////////////
Insp.UI.ModuleChildCtl = function(element)
{
    Insp.UI.ModuleChildCtl.initializeBase(this,[element]);
}

Insp.UI.ModuleChildCtl.prototype = {
    get_module: function()
    {
        return this.get_parent();
    },

    initialize: function()
    {
        if(Insp.UI.ModuleCtl.isInstanceOfType(this.get_parent())) this.get_parent().addComponent(this);
        Insp.UI.ModuleChildCtl.callBaseMethod(this,'initialize');
    },
    dispose: function()
    {
        Insp.UI.ModuleChildCtl.callBaseMethod(this,'dispose');
    }
}
Insp.UI.ModuleChildCtl.registerClass("Insp.UI.ModuleChildCtl", Sys.UI.Control);

/////////////////Insp.UI.ModuleContentCtl//////////////////
Insp.UI.ModuleContentCtl = function(element)
{
    Insp.UI.ModuleContentCtl.initializeBase(this,[element]);
}

Insp.UI.ModuleContentCtl.prototype = {
    initialize: function()
    {
        Insp.UI.ModuleContentCtl.callBaseMethod(this,'initialize');
    },
    dispose: function()
    {
        Insp.UI.ModuleContentCtl.callBaseMethod(this,'dispose');
    }
}
Insp.UI.ModuleContentCtl.registerClass("Insp.UI.ModuleContentCtl", Insp.UI.ModuleChildCtl);

/////////////////Insp.UI.ModuleEditCtl//////////////////
Insp.UI.ModuleEditCtl = function(element)
{
    Insp.UI.ModuleEditCtl.initializeBase(this,[element]);
    this._keyDelegate = null;    
}

Insp.UI.ModuleEditCtl.prototype = {
    add_enterPressed: function(handler){this.get_events().addHandler('enterPressed',handler);},
    remove_enterPressed: function(handler){this.get_events().removeHandler('enterPressed',handler);}, 
    
    initialize: function()
    {
        Insp.UI.ModuleEditCtl.callBaseMethod(this,'initialize');
        if(this._keyDelegate === null)
            this._keyDelegate = Function.createDelegate(this, this._keyHandler);
        $addHandler(this.get_element(),'keydown',this._keyDelegate);
    },
    dispose: function()
    {
        $removeHandler(this.get_element(),'keydown',this._keyDelegate);
        if(this._keyDelegate) delete this._keyDelegate;
        Insp.UI.ModuleEditCtl.callBaseMethod(this,'dispose');
    },
    _keyHandler: function(evt)
    {
        if(evt.keyCode == Sys.UI.Key.enter)
        {
            var f = this.get_events().getHandler('enterPressed');
            if(f)f(this,Sys.EventArgs.Empty);
        }
    }
}
Insp.UI.ModuleEditCtl.registerClass("Insp.UI.ModuleEditCtl", Insp.UI.ModuleChildCtl);


/////////////////Insp.UI.Paginator//////////////////

Insp.UI.Paginator = function(element)
{
    Insp.UI.Paginator.initializeBase(this,[element]);
    this._currentPage=1;
    this._itemsPerPage = 0;
    this._totalItems = 0;
    this._numPageLinks = 5;
    
    this._startPage=1;
    this._components = [];
    
    this._totalPageLinks = 0;
    this._propChangeDelegate = null;
    this._pageClickDelegate = null;
}

Insp.UI.Paginator.prototype = {
    get_currentPage: function(){return this._currentPage;},
    set_currentPage: function(value){this._currentPage = value;this.raisePropertyChanged('currentPage');},

    get_itemsPerPage: function(){return this._itemsPerPage;},
    set_itemsPerPage: function(value){this._itemsPerPage = value;this.raisePropertyChanged('itemsPerPage');},

    get_totalItems: function(){return this._totalItems;},
    set_totalItems: function(value){this._totalItems = value;this.raisePropertyChanged('totalItems');},

    get_numPageLinks: function(){return this._numPageLinks;},
    set_numPageLinks: function(value){this._numPageLinks = value;this.raisePropertyChanged('numPageLinks');},
    
    add_pageChanged: function(handler){this.get_events().addHandler('pageChanged',handler);},
    remove_pageChanged: function(handler){this.get_events().removeHandler('pageChanged',handler);},
    
    dispose: function()
    {
    
        if(this._propChangeDelegate) delete this._propChangeDelegate;
        Insp.UI.Paginator.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.Paginator.callBaseMethod(this,'initialize');    
        this.get_element().innerHTML = "<div id='paginateDiv'></div>";
        this.addCssClass("ptModPager");
        
        if (this._propChangeDelegate === null) {
            this._propChangeDelegate = Function.createDelegate(this, this._propChangeHandler);
        }
        this.add_propertyChanged(this._propChangeDelegate);
                
        if (this._pageClickDelegate === null) {
            this._pageClickDelegate = Function.createDelegate(this, this._pageClickHandler);
        }
    },
    _propChangeHandler: function(sender,property)
    {
        if(property.get_propertyName() == 'currentPage')
        {
            var pn = this.get_currentPage();
            if(pn<1){this.set_currentPage(1);return;}
            if(pn>this._totalPageLinks){this.set_currentPage(this._totalPageLinks);return;}
            //correction of startPage
            if(pn >= this._startPage+this.get_numPageLinks() || pn<this._startPage)
            {
                this._startPage = parseInt(pn/this.get_numPageLinks());
            }
            
            var args = new Insp.UI.PageChangeArg(pn,pn*this.get_itemsPerPage());
            var f = this.get_events().getHandler('pageChanged');
            if(f)f(this,args);
            
            this.updateLinks();
        }
    },
    _pageClickHandler:function(sender, args)
    {
        if(args.get_pageValue() == '-1')
        {
            if(this._startPage+this.get_numPageLinks() <= this._totalPageLinks)
                this._startPage+=this.get_numPageLinks();
            this.set_currentPage(this._startPage);
        }
        else if(args.get_pageValue() == '0')
        {
            if(this._startPage-this.get_numPageLinks() > 0)
                this._startPage-=this.get_numPageLinks();
            this.set_currentPage(this._startPage);
        }
        else
        {
            var pn = args.get_pageValue();
            if(pn<1 || pn > this._totalPageLinks)return;
            this.set_currentPage(pn);
        }
    },
    updated: function()
    {
        this._initLinks();
        this.updateLinks();
        Insp.UI.Paginator.callBaseMethod(this,'updated');
    },
    _createLinkCtl:function(id,text)
    {
        var oSpan = document.createElement('SPAN');
		oSpan.id = "pageLinkItem"+id;
		$get('paginateDiv',this.get_element()).appendChild(oSpan);   
		var e = $create(Insp.UI.PaginatorLink,{pageValue:id, pageText:text},{pageClicked:this._pageClickDelegate},{parent:this.get_id()},$get(oSpan.id,this.get_element()));
		this.addComponent(e); 
    },
    _findLinkCtl:function(id)
    {
        return this.findComponent('pageLinkItem' + id);
    },
    _initLinks:function()
    {
        if(!this._findLinkCtl('0'))this._createLinkCtl('0',"<span style='font-family:Arial;'>&#9668;</span>");//prev
        
        var numlinks = parseInt(this.get_totalItems()/this.get_itemsPerPage());
        if(this.get_totalItems()%this.get_itemsPerPage()) numlinks++;
        this._totalPageLinks = numlinks;
        
        for(var i = 1;i<=this._totalPageLinks;i++)
            if(!this._findLinkCtl(i))this._createLinkCtl(i,i);
        
        if(!this._findLinkCtl('-1'))this._createLinkCtl('-1',"<span style='font-family:Arial;'>&#9658;</span>");//next
    },
    updateLinks:function()
    {
        if(this._startPage > 1)
            this._findLinkCtl('0').set_visible(true);
        else
            this._findLinkCtl('0').set_visible(false);
            
        for(var i = 1;i<=this._totalPageLinks;i++)
            if(this._findLinkCtl(i))this._findLinkCtl(i).set_visible(false);
        
        for(var i= this._startPage;i< this._startPage + this.get_numPageLinks();i++)
            if(this._findLinkCtl(i))
            {   
                this._findLinkCtl(i).set_visible(true);
                if(this.get_currentPage() == i)
                    this._findLinkCtl(i).set_selected(true);
                else
                    this._findLinkCtl(i).set_selected(false);
            }
            
        this._findLinkCtl('-1').set_visible(false);
        if((this._startPage + this.get_numPageLinks()) < this._totalPageLinks)
            this._findLinkCtl('-1').set_visible(true);
        
        this.set_visible(true);
            
    },
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))
            this._components[e.get_id()] = e;
    },
    getComponents:function()
    {
        var a=[];b= this._components;
        for(var c in b)
        {
            a[a.length] = b[c];
        }
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}

Insp.UI.Paginator.registerClass('Insp.UI.Paginator',Sys.UI.Control,Sys.IContainer);

Insp.UI.PageChangeArg = function(pagenum, startItem)
{
    Insp.UI.PageChangeArg.initializeBase(this);
    this._currentPage = pagenum;
    this._startItem = startItem;
}
Insp.UI.PageChangeArg.prototype = 
{
    get_currentPage: function(){return this._currentPage;},
    set_currentPage:function(value){this._currentPage = value;},
    
    get_startItem: function(){return this._startItem;},
    set_startItem:function(value){this._startItem = value;}
}
Insp.UI.PageChangeArg.registerClass("Insp.UI.PageChangeArg", Sys.EventArgs);

Insp.UI.PageClickArg = function(pageVal)
{
    Insp.UI.PageClickArg.initializeBase(this);
    this._pageValue = pageVal;
}
Insp.UI.PageClickArg.prototype = 
{
    get_pageValue: function(){return this._pageValue;},
    set_pageValue:function(value){this._pageValue = value;}
}
Insp.UI.PageClickArg.registerClass("Insp.UI.PageClickArg", Sys.EventArgs);

Insp.UI.PaginatorLink = function(element)
{
    Insp.UI.PaginatorLink.initializeBase(this,[element]);
    this._pageValue = null;
    this._selected = false;
    this._pageText = null;
    
    this._propChangeDelegate = null;
    this._linkClickDelegate = null;
}

Insp.UI.PaginatorLink.prototype = {
    get_pageValue: function(){return this._pageValue;},
    set_pageValue: function(value){this._pageValue = value;this.raisePropertyChanged('pageValue');},

    get_selected: function(){return this._selected;},
    set_selected: function(value){this._selected = value;this.raisePropertyChanged('selected');},

    get_pageText: function(){return this._pageText;},
    set_pageText: function(value){this._pageText = value;this.raisePropertyChanged('pageText');},
    
    add_pageClicked: function(handler){this.get_events().addHandler('pageClicked',handler);},
    remove_pageClicked: function(handler){this.get_events().removeHandler('pageClicked',handler);},
    
    dispose: function()
    {
        $removeHandler(this.get_element(),'click',this._linkClickDelegate);
        if(this._linkClickDelegate) delete this._linkClickDelegate;
        if(this._propChangeDelegate) delete this._propChangeDelegate;
        Insp.UI.PaginatorLink.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.PaginatorLink.callBaseMethod(this,'initialize');    
     
        this.get_element().innerHTML = this.get_pageText();   
        this.addCssClass("ptModPageLink");
        
        this.set_visibilityMode(Sys.UI.VisibilityMode.collapse);
		 
        if (this._propChangeDelegate === null) {
            this._propChangeDelegate = Function.createDelegate(this, this._propChangeHandler);
        }
        
        if (this._linkClickDelegate === null) {
            this._linkClickDelegate = Function.createDelegate(this, this._linkClickHandler);
        }
        $addHandler(this.get_element(),'click',this._linkClickDelegate);
            
        this.add_propertyChanged(this._propChangeDelegate);
    },
    _propChangeHandler: function(sender,property)
    {
        if(property.get_propertyName() == 'selected')
        {
            if(this.get_selected())this.addCssClass('selPage');
            else this.removeCssClass('selPage');
        }
    },
    _linkClickHandler: function()
    {
        var args = new Insp.UI.PageClickArg(this.get_pageValue());
        var f = this.get_events().getHandler('pageClicked');
        if(f)f(this,args);
    },
    updated: function()
    {
        Insp.UI.PaginatorLink.callBaseMethod(this,'updated');
    }
}

Insp.UI.PaginatorLink.registerClass('Insp.UI.PaginatorLink',Sys.UI.Control);



/////////////////Insp.UI.TabStrip//////////////////

Insp.UI.TabStrip = function(element)
{
    Insp.UI.TabStrip.initializeBase(this,[element]);
    this._items=null;
    this._currentTab = null;

    this._components = [];
    
    this._propChangeDelegate = null;
    this._tabClickDelegate = null;
    this._leftNavClickDlg = null;
    this._rightNavClickDlg = null;
}

Insp.UI.TabStrip.prototype = {
    get_items: function(){return this._items;},
    set_items: function(value){this._items = value;this.raisePropertyChanged('items');},
    
    get_currentTab: function(){return this._currentTab;},
    set_currentTab: function(value){this._currentTab = value;this.raisePropertyChanged('currentTab');},
    
    add_tabChanged: function(handler){this.get_events().addHandler('tabChanged',handler);},
    remove_tabChanged: function(handler){this.get_events().removeHandler('tabChanged',handler);},
    
    dispose: function()
    {
    
        if(this._propChangeDelegate) delete this._propChangeDelegate;
        Insp.UI.TabStrip.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.TabStrip.callBaseMethod(this,'initialize');    
        this.get_element().innerHTML = "<div id='leftNav' class='ptModTSLeftNavOff'>&#9668</div> <div id='rightNav' class='ptModTSRightNavOn'>&#9658</div> <div id='tabItems' class='ptModTSItems'></div> ";
        this.addCssClass("ptModTabStrip");
        
        if (this._propChangeDelegate === null) {
            this._propChangeDelegate = Function.createDelegate(this, this._propChangeHandler);
        }
        this.add_propertyChanged(this._propChangeDelegate);
                
        if (this._tabClickDelegate === null) {
            this._tabClickDelegate = Function.createDelegate(this, this._tabClickHandler);
        }
        if (this._leftNavClickDlg === null) {
            this._leftNavClickDlg = Function.createDelegate(this, this._leftNavClickHnd);
        }
        $addHandler($get("leftNav",this.get_element()),'click',this._leftNavClickDlg);
        if (this._rightNavClickDlg === null) {
            this._rightNavClickDlg = Function.createDelegate(this, this._rightNavClickHnd);
        }
        $addHandler($get("rightNav",this.get_element()),'click',this._rightNavClickDlg);
    },
    _propChangeHandler: function(sender,property)
    {
        if(property.get_propertyName() == 'currentTab')
        {
            var args = new Insp.UI.TabChangeArg(this.get_currentTab());
            var f = this.get_events().getHandler('tabChanged');
            if(f)f(this,args);
            
            this.updateLinks();
        }
    },
    _tabClickHandler:function(sender, args)
    {
		var tv = args.get_tabValue();
        this.set_currentTab(tv);
    },
    updated: function()
    {
        this._initLinks();
        this.updateLinks();
        this._scrollTabIntoView(this.get_currentTab());
        Insp.UI.TabStrip.callBaseMethod(this,'updated');
    },
    _createLinkCtl:function(val,text)
    {
        var oSpan = document.createElement('SPAN');
		oSpan.id = "tabLinkItem"+val;
		$get('tabItems',this.get_element()).appendChild(oSpan);   
		var e = $create(Insp.UI.TabStripLink,{tabValue:val, tabText:text},{tabClicked:this._tabClickDelegate},{parent:this.get_id()},$get(oSpan.id,this.get_element()));
		this.addComponent(e); 
    },
    _findLinkCtl:function(id)
    {
        return this.findComponent('tabLinkItem' + id);
    },
    _initLinks:function()
    {
		for(var i = 0;i<this._items.length;i++)
            if(!this._findLinkCtl(this._items[i].value))this._createLinkCtl(this._items[i].value,this._items[i].name);

    },
    updateLinks:function()
    {
           
       for(var i = 0;i<this._items.length;i++)
            if(this._findLinkCtl(this._items[i].value))this._findLinkCtl(this._items[i].value).set_selected(false);
        
		var t = this._findLinkCtl(this.get_currentTab());
		if(t)t.set_selected(true);
 
        this.set_visible(true);
    },
    _leftNavClickHnd: function(sender,evt)
    {
		var lasthid = null;
		for(var i = 0;i<this._items.length;i++)
		{
			var e=this._findLinkCtl(this._items[i].value);
            if(!e.get_visible())
				lasthid = e;
			else
			{
				if(lasthid)lasthid.set_visible(true);
				if(i<=1){
					$get("leftNav",this.get_element()).className = "ptModTSLeftNavOff";
				}
				break;
			}
		}
		$get("rightNav",this.get_element()).className = "ptModTSRightNavOn";
    },
    _rightNavClickHnd: function(sender,evt)
    {
		for(var i = 0;i<this._items.length;i++)
		{
			var e=this._findLinkCtl(this._items[i].value);
            if(e.get_visible())
            {
				if(i!=(this._items.length-1)){
					e.set_visible(false);
					if(i==(this._items.length-2))
						$get("rightNav",this.get_element()).className = "ptModTSRightNavOff";
				}else{
					$get("rightNav",this.get_element()).className = "ptModTSRightNavOff";
				}
				break;
            }
		}
		$get("leftNav",this.get_element()).className = "ptModTSLeftNavOn";
    },
    _scrollTabIntoView: function(val)
    {
		var vis = false;
		for(var i = 0;i<this._items.length;i++)
		{
			var e=this._findLinkCtl(this._items[i].value);
            if(this._items[i].value==val)
            {
				vis=true;
				if(i!=0)$get("leftNav",this.get_element()).className = "ptModTSLeftNavOn";
				else $get("leftNav",this.get_element()).className = "ptModTSLeftNavOff";
				if(i<(this._items.length-1))$get("rightNav",this.get_element()).className = "ptModTSRightNavOn";
				else $get("rightNav",this.get_element()).className = "ptModTSRightNavOff";
            }
            e.set_visible(vis);
		}
    },
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))
            this._components[e.get_id()] = e;
    },
    getComponents:function()
    {
        var a=[];b= this._components;
        for(var c in b)
        {
            a[a.length] = b[c];
        }
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}

Insp.UI.TabStrip.registerClass('Insp.UI.TabStrip',Sys.UI.Control,Sys.IContainer);

Insp.UI.TabChangeArg = function(tabval)
{
    Insp.UI.TabChangeArg.initializeBase(this);
    this._currentTab = tabval;
}
Insp.UI.TabChangeArg.prototype = 
{
    get_currentTab: function(){return this._currentTab;},
    set_currentTab:function(value){this._currentTab = value;}
}
Insp.UI.TabChangeArg.registerClass("Insp.UI.TabChangeArg", Sys.EventArgs);

Insp.UI.TabClickArg = function(tabVal)
{
    Insp.UI.TabClickArg.initializeBase(this);
    this._tabValue = tabVal;
}
Insp.UI.TabClickArg.prototype = 
{
    get_tabValue: function(){return this._tabValue;},
    set_tabValue:function(value){this._tabValue = value;}
}
Insp.UI.TabClickArg.registerClass("Insp.UI.TabClickArg", Sys.EventArgs);

Insp.UI.TabStripLink = function(element)
{
    Insp.UI.TabStripLink.initializeBase(this,[element]);
    this._tabValue = null;
    this._selected = false;
    this._tabText = null;
    
    this._propChangeDelegate = null;
    this._linkClickDelegate = null;
}

Insp.UI.TabStripLink.prototype = {
    get_tabValue: function(){return this._tabValue;},
    set_tabValue: function(value){this._tabValue = value;this.raisePropertyChanged('tabValue');},

    get_selected: function(){return this._selected;},
    set_selected: function(value){this._selected = value;this.raisePropertyChanged('selected');},

    get_tabText: function(){return this._tabText;},
    set_tabText: function(value){this._tabText = value;this.raisePropertyChanged('tabText');},
    
    add_tabClicked: function(handler){this.get_events().addHandler('tabClicked',handler);},
    remove_tabClicked: function(handler){this.get_events().removeHandler('tabClicked',handler);},
    
    dispose: function()
    {
        $removeHandler(this.get_element(),'click',this._linkClickDelegate);
        if(this._linkClickDelegate) delete this._linkClickDelegate;
        if(this._propChangeDelegate) delete this._propChangeDelegate;
        Insp.UI.TabStripLink.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.TabStripLink.callBaseMethod(this,'initialize');    
     
        this.get_element().innerHTML = "<span class='ptModTSItemLeft'></span><span class='ptModTSItem'>"+this.get_tabText()+"</span><span class='ptModTSItemRight'></span>";   
        this.get_element().className = "ptModTSLinkOff";
        
        this.set_visibilityMode(Sys.UI.VisibilityMode.collapse);
		 
        if (this._propChangeDelegate === null) {
            this._propChangeDelegate = Function.createDelegate(this, this._propChangeHandler);
        }
        
        if (this._linkClickDelegate === null) {
            this._linkClickDelegate = Function.createDelegate(this, this._linkClickHandler);
        }
        $addHandler(this.get_element(),'click',this._linkClickDelegate);
            
        this.add_propertyChanged(this._propChangeDelegate);
    },
    _propChangeHandler: function(sender,property)
    {
        if(property.get_propertyName() == 'selected')
        {
            if(this.get_selected())this.get_element().className = "ptModTSLinkOn";
            else this.get_element().className = "ptModTSLinkOff";
        }
    },
    _linkClickHandler: function()
    {
        var args = new Insp.UI.TabClickArg(this.get_tabValue());
        var f = this.get_events().getHandler('tabClicked');
        if(f)f(this,args);
    },
    updated: function()
    {
        Insp.UI.TabStripLink.callBaseMethod(this,'updated');
    }
}

Insp.UI.TabStripLink.registerClass('Insp.UI.TabStripLink',Sys.UI.Control);


if (typeof(Sys) !== 'undefined')Sys.Application.notifyScriptLoaded();

Type.registerNamespace("Insp");
Type.registerNamespace("Insp.UI");
var currModule = null;

Insp.UI.AccuWeather = function(element)
{
    Insp.UI.AccuWeather.initializeBase(this,[element]);
    this._city = "";
    this._state = "";
    this._tempType = "";
    this._title = "";
    this._postalcode = "";
    this._accuUrl="";    
    this._callbackDelegate = null;
    
    this._weatherConditions = null;
    this._forecastInfo = null;
    this._moduleClientID =  null;
    this._updatePanelID = null;
    this._components = [];
}

Insp.UI.AccuWeather.prototype = {
    get_city: function(){return this._city;},
    set_city: function(value){this._city = value;this.raisePropertyChanged('city');},
    
    get_state: function(){return this._state;},
    set_state: function(value){this._state = value;this.raisePropertyChanged('state');},
    
    get_tempType: function(){return this._tempType;},
    set_tempType: function(value){this._tempType = value;this.raisePropertyChanged('tempType');},

    get_postalcode: function(){return this._postalcode;},
    set_postalcode: function(value){this._postalcode = value;this.raisePropertyChanged('postalcode');},

    get_title: function(){return this._title;},
    set_title: function(value){this._title = value;this.raisePropertyChanged('title');},
    
    get_moduleClientID: function(){return this._moduleClientID;},
    set_moduleClientID: function(value){this._moduleClientID = value;this.raisePropertyChanged('moduleClientID');},

    get_onlyforecast: function(){return this._onlyforecast;},
    set_onlyforecast: function(value){this._onlyforecast = value;this.raisePropertyChanged('onlyforecast');},

    get_accuUrl: function(){return this._accuUrl;},
    set_accuUrl: function(value){this._accuUrl = value;this.raisePropertyChanged('accuUrl');},
    
    dispose: function()
    {
        if(this._callbackDelegate) delete this._callbackDelegate;
        Insp.UI.AccuWeather.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.AccuWeather.callBaseMethod(this,'initialize');
		this.addCssClass("ptModWeather");
		this.addCssClass("moduleloading");
		if (this._callbackDelegate === null) {
            this._callbackDelegate = Function.createDelegate(this, this.callbackHandler);
        }
    },
    updated: function()
    {
        this.get_module().set_moduleTitle(this.get_title());
        Portal.ClientAccuWeatherSvc.GetWeatherData(this.get_city(),this.get_state(),this.get_tempType(),this.get_postalcode(),this._callbackDelegate);
        Insp.UI.AccuWeather.callBaseMethod(this,'updated');
    },
    callbackHandler: function(results)
    {
		if(results.length > 0)
		{
		    this.removeCssClass("moduleloading");
            this._weatherConditions = results;
            this._clearComponents();
            this._createComponents();      
        }
        else
        {
            var errorDiv = "<div><div style='margin:0px' class='feedErrorMessage'>Sorry, this service is not currently available.</div></div>";            
            this.get_element().innerHTML = errorDiv;
            this.removeCssClass("moduleloading");
        }
    },
    
    _createComponents: function()
    {        
        var url=this.get_accuUrl();
        url=url.replace('[ZCODE]',this.get_postalcode());
        //Double check if you are getting valid stuff
        if(this._weatherConditions.length > 0)
        {
            var _cityState = this._weatherConditions[0].City + ", " + this._weatherConditions[0].State;
            var _feelsLike = "Feels like " + this._weatherConditions[0].FeelLike;
            var _wind = "Winds: " + this._weatherConditions[0].WindDirection + " " + this._weatherConditions[0].WindSpeed;
            var mDiv = document.createElement('div');
		    mDiv.id = "mainDiv";
		    mDiv.className = "ptModWeather";
		    mDiv.innerHTML = "<div class='ptTopContainer'><div><img class='ptImage' src='"+this.get_module().get_akamaiUrlPrefix()+this._weatherConditions[0].ImagePath+this.get_module().get_akamaiUrlSuffix()+"' alt='"+this._weatherConditions[0].ImageTitle+"'/>"
		                    + "<span class='ptLocation'>"+_cityState+"</span><span class='ptTemp'>"+this._weatherConditions[0].Temperature+"</span><span class='ptFeelLike'>"
		                    +_feelsLike+"</span><span class='ptWind'>"+_wind+"</span></div></div>"
		                    +"<div id='subPanel' class='ptshowMoreContainer'><img onclick='window.open(\""+url+"\",\"_blank\");' style='float:right; padding-right:5px; padding-top:4px; cursor:pointer;' src='"+this.get_module().get_akamaiUrlPrefix()+"accuweatherlogo.png"+this.get_module().get_akamaiUrlSuffix()+"' title='Click for weather details'/><img id='expandImg' onclick='ClientAccuWeather.ExpandPanel(this);' src='01_max.gif' class='ptImgShowMore'/><span id='showmore' onclick='ClientAccuWeather.ExpandPanel(this);' class='ptShowmore'>Show more</span></div>"
		                    +"<div id='morePanel' style='display:none'></div>";
		    
		    if(!eval(this.get_onlyforecast()))
		    {
		        //Backup Radar Url
		       $get('radarUrl',this.get_element().parentNode).innerHTML = this._weatherConditions[0].RadarUrl;
		    }
		    currModule = this.get_module();
		    this.get_element().appendChild(mDiv);
		    var e = $create(Insp.UI.MoreAccuWeather,{city:this.get_city(),state:this.get_state(),tempType:this.get_tempType(),postalcode:this.get_postalcode(),onlyforecast:this.get_onlyforecast(),akamaiUrlPrefix:this.get_module().get_akamaiUrlPrefix(),akamaiUrlSuffix:this.get_module().get_akamaiUrlSuffix()},null,{parent:this.get_id()},$get('morePanel',mDiv));
		    this.addComponent(e);
        }
    },
    _clearComponents: function()
    {
        for(var a in this._components)
        {
            delete this._components[a];
        }
    },
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))
            this._components[e.get_id()] = e;
    },
    getComponents:function()
    {
        var a=[];b= this._components;
        for(var c in b)
        {
            a[a.length] = b[c];
        }
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}

Insp.UI.AccuWeather.registerClass('Insp.UI.AccuWeather',Insp.UI.ModuleContentCtl,Sys.IContainer);

Insp.UI.MoreAccuWeather = function(element)
{
    Insp.UI.MoreAccuWeather.initializeBase(this,[element]);
    this._forecastInfo = null;
    this._city = "";
    this._state = "";
    this._tempType = "";
    this._postalcode = "";
    
    this._forecastDelegate = null;
    this._components = [];
}
Insp.UI.MoreAccuWeather.prototype = 
{
    get_city: function(){return this._city;},
    set_city: function(value){this._city = value;this.raisePropertyChanged('city');},
    
    get_state: function(){return this._state;},
    set_state: function(value){this._state = value;this.raisePropertyChanged('state');},
    
    get_tempType: function(){return this._tempType;},
    set_tempType: function(value){this._tempType = value;this.raisePropertyChanged('tempType');},

    get_postalcode: function(){return this._postalcode;},
    set_postalcode: function(value){this._postalcode = value;this.raisePropertyChanged('postalcode');},
    
    get_onlyforecast: function(){return this._onlyforecast;},
    set_onlyforecast: function(value){this._onlyforecast = value;this.raisePropertyChanged('onlyforecast');},

    get_akamaiUrlPrefix: function(){return this._akamaiUrlPrefix;},
    set_akamaiUrlPrefix:function(value){this._akamaiUrlPrefix = value;this.raisePropertyChanged('akamaiUrlPrefix');},

    get_akamaiUrlSuffix: function(){return this._akamaiUrlSuffix;},
    set_akamaiUrlSuffix:function(value){this._akamaiUrlSuffix = value;this.raisePropertyChanged('akamaiUrlSuffix');},
        
       initialize: function()
       {           
           Insp.UI.MoreAccuWeather.callBaseMethod(this,'initialize');
            
             if (this._forecastDelegate === null) {
            this._forecastDelegate = Function.createDelegate(this, this.forecastHandler);
            }
       },
       dispose: function()
       {      
            Insp.UI.MoreAccuWeather.callBaseMethod(this,'dispose');
       },   
       updated: function()
       {
            Portal.ClientAccuWeatherSvc.GetForecastData(this.get_city(),this.get_state(),this.get_tempType(),this.get_postalcode(),this._forecastDelegate);
       },
       forecastHandler: function(results)
       {            
            if(results.length > 0)
		    {
                this._forecastInfo = results;
                //Backup forecast data
                var topObj = GetModuleTop(this.get_element());
                var fcstArr = GetObjectInModule(topObj,'DIV','fcstArray');
                fcstArr.innerHTML = this._forecastInfo;
                this._clearComponents();
                this._createComponents();      
            }
       },
       _createComponents: function()
       {
            var sDiv =  document.createElement('div');
		    sDiv.id = "subDiv";
		    if(!eval(this.get_onlyforecast()))
            {
		                    sDiv.innerHTML = "<table width='100%' cellpadding='0' cellspacing='0' class='ptModTabFrame'>"
                                           +"<tr width='100%'><td width='33%' id='tabForecastCell' onclick=\"ClientAccuWeather.SwitchTabs(this,'F');\">"
                                           +"<div id='tabForecast' width='100%' class='tabcellSelected' style='font-weight:bold'>Forecast</div></td>"
                                           +"<td id='tabNationalCell' width='33%' onclick=\"ClientAccuWeather.SwitchTabs(this,'N');\">"
                                           +"<div id='tabNational' width='100%' class='tabcellUnSelected' style='font-weight:bold'>Radar/Satellite</div></td>"
                                           +"<td id='tabTemperatureCell' width='33%' onclick=\"ClientAccuWeather.SwitchTabs(this,'T');\">"
                                           +"<div id='tabTemperature' width='100%' class='tabcellUnSelected' style='font-weight:bold'>Temperature</div></td></tr>"
                                           +"<tr><td colspan='3'><div id='floatingDiv'></div></td></tr></table>";            
            }
            else
            {
                sDiv.innerHTML = "<div id='floatingDiv'></div>";
            }  
            this.get_element().appendChild(sDiv);
            
            var e = $create(Insp.UI.AccuWeather.ForecastPanel,{forecastInfo:this._forecastInfo,akamaiUrlPrefix:this.get_akamaiUrlPrefix(),akamaiUrlSuffix:this.get_akamaiUrlSuffix()},null,{parent:this.get_id()},$get('floatingDiv',sDiv));
            this.addComponent(e);
       },
    _clearComponents: function()
    {
        for(var a in this._components)
        {
            delete this._components[a];
        }
    },
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))
            this._components[e.get_id()] = e;
    },
    getComponents:function()
    {
        var a=[];b= this._components;
        for(var c in b)
        {
            a[a.length] = b[c];
        }
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}

Insp.UI.MoreAccuWeather.registerClass('Insp.UI.MoreAccuWeather',Sys.UI.Control);

Insp.UI.AccuWeather.ForecastPanel = function(element)
{
    Insp.UI.AccuWeather.ForecastPanel.initializeBase(this,[element]);
    this._forecastInfo = null;    
}
Insp.UI.AccuWeather.ForecastPanel.prototype = 
{
       get_forecastInfo: function(){return this._forecastInfo;},
       set_forecastInfo:function(value){this._forecastInfo = value;this.raisePropertyChanged('forecastInfo');},

       get_akamaiUrlPrefix: function(){return this._akamaiUrlPrefix;},
       set_akamaiUrlPrefix:function(value){this._akamaiUrlPrefix = value;this.raisePropertyChanged('akamaiUrlPrefix');},

       get_akamaiUrlSuffix: function(){return this._akamaiUrlSuffix;},
       set_akamaiUrlSuffix:function(value){this._akamaiUrlSuffix = value;this.raisePropertyChanged('akamaiUrlSuffix');},
        
       initialize: function()
       {            
           
           Insp.UI.AccuWeather.ForecastPanel.callBaseMethod(this,'initialize');
            
            var radarDiv = $get("radarDiv",this.get_element());
            if(radarDiv != null)radarDiv.style.display = 'none';
            
            var tempDiv = $get("tempDiv",this.get_element());
            if(tempDiv != null)tempDiv.style.display = 'none';
            
            var fDiv =  document.createElement('div');
		    fDiv.id = "fcstDiv";
		    fDiv.style.display = 'block';
		    fDiv.className = 'ptForeCastContainer';
		    fDiv.innerHTML = "<table width='100%' cellpadding='0' cellspacing='7'>"
                             +"<tr id='fcstSet'></tr></table>";
            
            for(z=0;z<this.get_forecastInfo().length;z++)
            {
                var _wrow = $get('fcstSet',fDiv);
                var cell = document.createElement('td');                
                cell.className = 'ptDatalistStyle';
                cell.id='wfcstcell' + z;
                cell.innerHTML = "<span id='wDay"+z+"' class='ptForecastDay'>"+this.get_forecastInfo()[z].ForecastDay+"</span>"
                                 +"<span id='wDate"+z+"' class='ptForecastDate'>"+this.get_forecastInfo()[z].ForecastDate+"</span>"
                                 +"<img id='wImage"+z+"' class='ptForecastImage' src='"+this.get_akamaiUrlPrefix()+this.get_forecastInfo()[z].ImagePath+this.get_akamaiUrlSuffix()+"' alt='"+this.get_forecastInfo()[z].ImageTitle+"' />"
                                 +"<span id='wHighTemp"+z+"' class='ptForecastHighTemp'>"+this.get_forecastInfo()[z].HighTemp+"</span>"
                                 +"<span id='wLowTemp"+z+"' class='ptForecastLowTemp'>"+this.get_forecastInfo()[z].LowTemp+"</span>";
                _wrow.appendChild(cell);                
            }
                                           
            this.get_element().appendChild(fDiv);
       },
       dispose: function()
       {      
            Insp.UI.AccuWeather.ForecastPanel.callBaseMethod(this,'dispose');
       },   
       updated: function()
       {
       }
}

Insp.UI.AccuWeather.ForecastPanel.registerClass('Insp.UI.AccuWeather.ForecastPanel',Sys.UI.Control);

Insp.UI.AccuWeather.RadarPanel = function(element)
{
    Insp.UI.AccuWeather.RadarPanel.initializeBase(this,[element]);
    this._urlSet = null;    
}
Insp.UI.AccuWeather.RadarPanel.prototype = 
{
       initialize: function()
       {            
           
           Insp.UI.AccuWeather.RadarPanel.callBaseMethod(this,'initialize');
            
            var fcstDiv = $get("fcstDiv",this.get_element());
            if(fcstDiv != null)fcstDiv.style.display = 'none';
            
            var tempDiv = $get("tempDiv",this.get_element());
            if(tempDiv != null)tempDiv.style.display = 'none';
            
            //Create Main radar Div   
            var radDiv =  document.createElement('div');
		    radDiv.id = "radarDiv";
		    radDiv.style.display = 'block';
		    radDiv.className = 'ptRadarContainer';
            this.get_element().appendChild(radDiv);
            
            var rDiv =  document.createElement('div');
		    rDiv.id = "rdrDiv";
		    rDiv.className = 'ptRadarLinks';
		    
		    var topObj = GetModuleTop(this.get_element());
            var radarUrl = GetObjectInModule(topObj,'DIV','radarUrl').innerHTML;
		    if(radarUrl != null)
		    {
		        if(radarUrl.indexOf('|') > 0)
		        {
		            this._urlSet = radarUrl.split('|');
		        }
		    }
		    rDiv.innerHTML = "<span id='lnkLocal' class='radarSelectLink' onclick=\"ClientAccuWeather.ChangeRadarUrl(this,'L')\" >Local</span>|"
		                     +"<span id='lnkState' class='radarUnSelectLink' onclick=\"ClientAccuWeather.ChangeRadarUrl(this,'ST')\" >State</span>|"
		                     +"<span id='lnkSatellite' class='radarUnSelectLink' onclick=\"ClientAccuWeather.ChangeRadarUrl(this,'SA')\" >Satellite</span>";
		                     
            radDiv.appendChild(rDiv);
            
            var radarImg = document.createElement('img');
            radarImg.id = "imgRadarMap";
            radarImg.className = (this._urlSet != null)?"weathermap":"";
            radarImg.src = (this._urlSet != null)? this._urlSet[0]: "";              
            radDiv.appendChild(radarImg);
       },
       dispose: function()
       {      
            Insp.UI.AccuWeather.RadarPanel.callBaseMethod(this,'dispose');
       },   
       updated: function()
       {
       }
}

Insp.UI.AccuWeather.RadarPanel.registerClass('Insp.UI.AccuWeather.RadarPanel',Sys.UI.Control);

Insp.UI.AccuWeather.TempPanel = function(element)
{
    Insp.UI.AccuWeather.TempPanel.initializeBase(this,[element]);  
}
Insp.UI.AccuWeather.TempPanel.prototype = 
{
       initialize: function()
       {            
           
           Insp.UI.AccuWeather.TempPanel.callBaseMethod(this,'initialize');
            
            var fcstDiv = $get("fcstDiv",this.get_element());
            if(fcstDiv != null)fcstDiv.style.display = 'none';
            
            var radarDiv = $get("radarDiv",this.get_element());
            if(radarDiv != null)radarDiv.style.display = 'none';
            
             //Create Main radar Div   
            var tempDiv =  document.createElement('div');
		    tempDiv.id = "tempDiv";
		    tempDiv.style.display = 'block';
		    tempDiv.className = 'ptTmpContainer';
            this.get_element().appendChild(tempDiv);
            
            var todayUrl = "http://pics.mobile.infospace.com/dynpics/AccuWeather_images/en/other/320/todtemp.png";
            var tDiv =  document.createElement('div');
		    tDiv.id = "tmpDiv";
		    tDiv.className = 'ptTmpLinks';
		    tDiv.innerHTML = "<span id='lnkToday' class='tmpSelectLink' onclick=\"ClientAccuWeather.ChangeTempUrl(this,'TY')\">Today</span>|"
		                     +"<span id='lnkTonight' class='tmpUnSelectLink' onclick=\"ClientAccuWeather.ChangeTempUrl(this,'TN')\">Tonight</span>|"
		                     +"<span id='lnkTomorrow' class='tmpUnSelectLink' onclick=\"ClientAccuWeather.ChangeTempUrl(this,'TM')\">Tomorrow</span>"
                                           
            tempDiv.appendChild(tDiv);
            
            var tempImg = document.createElement('img');
            tempImg.id = "imgTempMap";
            tempImg.className = "weathermap";
            tempImg.src = todayUrl;              
            tempDiv.appendChild(tempImg);
       },
       dispose: function()
       {      
            Insp.UI.AccuWeather.TempPanel.callBaseMethod(this,'dispose');
       },   
       updated: function()
       {
       }
}

Insp.UI.AccuWeather.TempPanel.registerClass('Insp.UI.AccuWeather.TempPanel',Sys.UI.Control);

Insp.UI.AccuWeatherEdit = function(element)
{
    Insp.UI.AccuWeatherEdit.initializeBase(this,[element]);
    this._city = "";
    this._state = "";
    this._tempType = "";
    this._title = "";
    this._postalcode = "";
    this._changetitle = true;
    this._saveBtnID = null;
    this._cancelBtnID = null;
    this._updatePanelID = null;
    this._moduleClientID = null;
    this._errorMessage1 = "Sorry, we could not find the location.<br>Try again.";
    this._errorMessage2 = "Please enter a valid Postal Code or City,State. Value should not be Empty.";
    this._errorMessage3 = "Please enter a valid Postal Code or City,State. Value should not contain characters like '<', '>'.";
    this._wError = false;
    
    this._saveClickDelegate = null;
    this._cancelClickDelegate = null;
    this._saveCallbackSuccessDelegate = null;
    this._saveCallbackFailureDelegate = null;        
    this._USLocationsDelegate = null;
    this._PostCodeDelegate = null;
    this._MultiLocationsDelegate = null;
    this._EnterKeyPressedDelegate = null;
}

Insp.UI.AccuWeatherEdit.prototype = {
    get_city: function(){return this._city;},
    set_city: function(value){this._city = value;this.raisePropertyChanged('city');},
    
    get_state: function(){return this._state;},
    set_state: function(value){this._state = value;this.raisePropertyChanged('state');},
    
    get_tempType: function(){return this._tempType;},
    set_tempType: function(value){this._tempType = value;this.raisePropertyChanged('tempType');},

    get_postalcode: function(){return this._postalcode;},
    set_postalcode: function(value){this._postalcode = value;this.raisePropertyChanged('postalcode');},

    get_title: function(){return this._title;},
    set_title: function(value){this._title = value;this.raisePropertyChanged('title');},
    
    get_changetitle: function(){return this._changetitle;},
    set_changetitle: function(value){this._changetitle = value;this.raisePropertyChanged('changetitle');},
    
    get_moduleClientID: function(){return this._moduleClientID;},
    set_moduleClientID: function(value){this._moduleClientID = value;this.raisePropertyChanged('moduleClientID');},
    
    dispose: function()
    {
                
        if(this._saveCallbackFailureDelegate) delete this._saveCallbackFailureDelegate;
        if(this._saveCallbackSuccessDelegate) delete this._saveCallbackSuccessDelegate;
        
        $removeHandler($get('BtnCancel',this.get_element()),'click',this._cancelClickDelegate);
        if(this._cancelClickDelegate) delete this._cancelClickDelegate;
        
        $removeHandler($get('BtnSave',this.get_element()),'click',this._saveClickDelegate);
        if(this._saveClickDelegate) delete this._saveClickDelegate;
        
        if(this._USLocationsDelegate) delete this._USLocationsDelegate;
        if(this._PostCodeDelegate) delete this._PostCodeDelegate;
        if(this._MultiLocationsDelegate) delete this._MultiLocationsDelegate;
        if(this._EnterKeyPressedDelegate) delete this._EnterKeyPressedDelegate;
        
        Insp.UI.AccuWeatherEdit.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.AccuWeatherEdit.callBaseMethod(this,'initialize');
        if (this._saveClickDelegate === null) {
            this._saveClickDelegate = Function.createDelegate(this, this._saveClickHandler);
        }
        $addHandler($get('BtnSave',this.get_element()),'click',this._saveClickDelegate);

        if (this._cancelClickDelegate === null) {
            this._cancelClickDelegate = Function.createDelegate(this, this._cancelClickHandler);
        }
        $addHandler($get('BtnCancel',this.get_element()),'click',this._cancelClickDelegate);
        
        if (this._saveCallbackSuccessDelegate === null) {
            this._saveCallbackSuccessDelegate = Function.createDelegate(this, this._saveCallbackSuccessHandler);
        }
        
        if (this._saveCallbackFailureDelegate === null) {
            this._saveCallbackFailureDelegate = Function.createDelegate(this, this._saveCallbackFailureHandler);
        }
        
        if (this._USLocationsDelegate === null) {
            this._USLocationsDelegate = Function.createDelegate(this, this._USLocationsHandler);
        }
        
        if (this._PostCodeDelegate === null) {
            this._PostCodeDelegate = Function.createDelegate(this, this._PostCodeHandler);
        }
        
        if (this._MultiLocationsDelegate === null) {
            this._MultiLocationsDelegate = Function.createDelegate(this, this._MultiLocationsHandler);
        }
        
         if (this._EnterKeyPressedDelegate === null) {
            this._EnterKeyPressedDelegate = Function.createDelegate(this, this._saveClickHandler);
        }
        
        //Handle Enter Key
        this.add_enterPressed(this._EnterKeyPressedDelegate);
        
        this._initValues();
    },
    _initValues: function()
    {
        $get("criteria",this.get_element()).value = this.get_city() + ", " + this.get_state();
        $get('tempType',this.get_element()).value = this.get_tempType();
    },
    updated: function()
    {
        Insp.UI.AccuWeatherEdit.callBaseMethod(this,'updated');
    },
    _saveClickHandler: function(eventObj)
    {
        var loc = $get("criteria",this.get_element()).value;
        var tempType = $get('tempType',this.get_element()).value;
        if(tempType.length > 0)this.set_tempType(tempType);
        
        if(loc.length == 0)
        {
            ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage2);
            this._wError = true;
        }
        if(loc.trim().indexOf(',') >= 0)
        {           
            var cs = loc.split(',');
            var vs = (cs[0].trim().length == 0 || cs[1].trim().length == 0) ? false : true;
            if(cs.length == 2 && vs)
            {
                Portal.ClientAccuWeatherSvc.GetLocations(loc,this._USLocationsDelegate);
            }
            else
            {
                ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage3);
                this._wError = true;
            }
        }
        else
        {
            var locn =  loc.match(new RegExp("(^\\d{5}$)|(^\\d{5}[-\\s]\\d{4}$)"));
            if(locn != null)
            {
                //Double check
                if((!isNaN(loc)) && locn[0].trim().length == 5)
                {
                    this.set_postalcode(loc.trim());
                    Portal.ClientAccuWeatherSvc.GetPostalCode(loc.trim(),this._PostCodeDelegate);
                }
                else
                {
                    ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage3);
                    this._wError = true;
                }
            }
            else
            {
                if(loc.indexOf('>') > -1 || loc.indexOf('<') > -1)
                {
                    //Error
                    ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage3);
                    this._wError = true;
                }
                else
                {
                    Portal.ClientAccuWeatherSvc.GetLocations(loc,this._MultiLocationsDelegate);
                }
            }
        }
    },
    _cancelClickHandler: function(eventObj)
    {
        this.get_module().set_showEditPart(false);
        this._initValues();
        
        //Clear Error Message
        var obj = $get("errorMessage",this.get_element());
        obj.innerHTML = "";
        obj.style.display = "none";
        
        //Clear Multiple Results
        var mDiv = $get("ResultsPanel",this.get_element());
        if(mDiv)mDiv.innerHTML = "";
    },
    _saveCallbackSuccessHandler: function(res)
    {
        if(res == "success")
        {
            if(this.get_module())this.get_module().refreshModule();
        }
    },
    _saveCallbackFailureHandler: function()
    {
    },
    _USLocationsHandler: function(locres)
    {
        if(locres != null)
        {
            if(locres[0].indexOf(',') > 0)
            {
                var cityStateZip = locres[0].split(',');
                this.set_city(cityStateZip[0].trim());
                this.set_state(cityStateZip[1].trim());
                if(cityStateZip.length > 2)
                    this.set_postalcode(cityStateZip[2].trim());
                if(this._wError) this._wError = false;
            }
            else
            {
                ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage1);
                this._wError = true;
            }
            this._SaveCall();
        }
        else
        {
            //Error
             ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage1);
             this._wError = true;
        }
    },
    _PostCodeHandler: function(postresults)
    {
        if(postresults != null && postresults.length > 0)
        {
            if(postresults.indexOf(',') > 0)
            {
                var cityStateZip = postresults.split(',');
                this.set_city(cityStateZip[0].trim());
                this.set_state(cityStateZip[1].trim());
                if(cityStateZip.length > 2)
                    this.set_postalcode(cityStateZip[2].trim());
                if(this._wError) this._wError = false;
            }
            else
            {
                this.get_postalcode("");
                ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage1);
                this._wError = true;
            }
            this._SaveCall();
        }
        else
        {
            //Error
             this.get_postalcode("");
             ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage1);
             this._wError = true;
        }
    },
    _MultiLocationsHandler: function(result)
    {
        if(result != null)
        {
            if(result.length > 1)
            {
                if(this._wError) this._wError = false;
                $create(Insp.UI.WeatherMultipleResults,{results:result,city:this.get_city(),state:this.get_state(),changetitle:this.get_changetitle(),tempType:this.get_tempType(),moduleClientID:this.get_moduleClientID()},null,null,$get('ResultsPanel',this.get_element()));  
            }
            else if(result.length == 1)
            {
                if(result[0].indexOf(',') > 0)
                {
                    var cityStateZip = result[0].split(',');
                    this.set_city(cityStateZip[0]);
                    this.set_state(cityStateZip[1]);
                    if(cityStateZip.length > 2)
                        this.set_postalcode(cityStateZip[2].trim());
                    if(this._wError) this._wError = false;
                    this._SaveCall();
                }
            }
         }
         else
         {
             //Error
             this.get_postalcode("");
             ClientAccuWeather.DisplayError($get("errorMessage",this.get_element()),this._errorMessage1);
             this._wError = true;
         }
    },
    _SaveCall: function()
    {
        if(!this._wError)
        {
            if(this.get_changetitle())
            {
                this.set_title("Weather: " + this.get_city() + ", " + this.get_state());
            }
            Portal.ClientAccuWeatherSvc.UpdateChanges(this.get_city(),this.get_state(),this.get_title(),this.get_postalcode(),this.get_tempType(),this.get_moduleClientID(),this._saveCallbackSuccessDelegate,this._saveCallbackFailureDelegate);    
        }
        else
        {
            return false;
        }
    }
}

Insp.UI.AccuWeatherEdit.registerClass('Insp.UI.AccuWeatherEdit',Insp.UI.ModuleEditCtl);

Insp.UI.WeatherMultipleResults = function(element)
{
    this._city = "";
    this._state = "";
    this._postalcode="";
    this._tempType = "";    
    this._moduleClientID = null;
    this._paginator = null;
    this._currentPage = '1';
    this._changetitle = true;
    this._itemsPerPage = '5';
    this._results = null;
    this._pageChangedDelegate = null;   
    this._components = [];
    Insp.UI.WeatherMultipleResults.initializeBase(this,[element]);  
}
Insp.UI.WeatherMultipleResults.prototype = 
{
       get_results: function(){return this._results;},
       set_results: function(value){this._results = value;this.raisePropertyChanged('results');},
       
       get_city: function(){return this._city;},
       set_city: function(value){this._city = value;this.raisePropertyChanged('city');},
    
        get_state: function(){return this._state;},
        set_state: function(value){this._state = value;this.raisePropertyChanged('state');},
        
        get_postalcode: function(){return this._postalcode;},
        set_postalcode: function(value){this._postalcode = value;this.raisePropertyChanged('postalcode');},
        
        get_tempType: function(){return this._tempType;},
        set_tempType: function(value){this._tempType = value;this.raisePropertyChanged('tempType');},
        
        get_moduleClientID: function(){return this._moduleClientID;},
        set_moduleClientID: function(value){this._moduleClientID = value;this.raisePropertyChanged('moduleClientID');},
        
        get_changetitle: function(){return this._changetitle;},
        set_changetitle: function(value){this._changetitle = value;this.raisePropertyChanged('changetitle');},
    
       initialize: function()
       {            
           Insp.UI.WeatherMultipleResults.callBaseMethod(this,'initialize');
           
            if (this._pageChangedDelegate === null) {
            this._pageChangedDelegate = Function.createDelegate(this, this._pageChangedHandler);
        }
       },
       dispose: function()
       {      
            Insp.UI.WeatherMultipleResults.callBaseMethod(this,'dispose');
       },   
       updated: function()
       {
            this._getCurrentList(null);
            //Insp.UI.WeatherMultipleResults(this,'updated');
       },
       _constructList: function(loclist,callType)
       {            
            //Reconstruct Result Set for a new call
            if(callType == null)
            {
                this.get_element().innerHTML = "";
            }
            if($get('locMessage',this.get_element())== null)
            {
                var lspan = document.createElement('SPAN');
                lspan.id = "locMessage";
                lspan.className = "multiResults";
                lspan.innerHTML = "Multiple matches found. Please, select one.";
                this.get_element().appendChild(lspan);
            }
            
            if($get('mulDiv',this.get_element())== null)
            {
                var mulDiv = document.createElement('div');
                mulDiv.id = "mulDiv";
                this.get_element().appendChild(mulDiv);
            }
            
            var resultsDiv = $get("mulDiv",this.get_element());
            var actualLength = null;
            var linkSet = "<table>";
            var params = "\'" + this.get_city() + "\',\'" + this.get_state() + "\',\'"+ this.get_postalcode()+"\',\'" +this.get_tempType() + "\',\'" + this.get_moduleClientID() + "\',\'" + this.get_changetitle() + "\'";            
            for(iX=0;iX<5;iX++)
            {
                if(typeof(loclist[iX]) == 'undefined')break;
                var cityStateZip = loclist[iX].split(',');
                if(cityStateZip.length > 2)
                    params = "\'" + cityStateZip[0].trim() + "\',\'" + cityStateZip[1].trim() + "\',\'"+ cityStateZip[2].trim()+"\',\'" +this.get_tempType() + "\',\'" + this.get_moduleClientID() + "\',\'" + this.get_changetitle() + "\'";
                linkSet += "<tr><td><a onclick=\"ClientAccuWeather.SaveData(this," + params +")\" class='ptgridViewLnkbtn'>"+ cityStateZip[0].trim() + ", " + cityStateZip[1].trim() +"</a></td></tr>";                
            }
            linkSet += "</table>";
            if(!this._paginator && $get('wthrPager',this.get_element())== null)
            {
                //Create the Pager
                var wpager = document.createElement('div');
                wpager.id = "wthrPager";
                wpager.className = "nhpager";
                this.get_element().appendChild(wpager);
                var e = $create(Insp.UI.Paginator,{currentPage:this._currentPage, itemsPerPage:this._itemsPerPage,totalItems:this.get_results().length,numPageLinks:5},{pageChanged:this._pageChangedDelegate},{parent:this.get_id()},wpager);
	            this.addComponent(e);
	            this._paginator = e;
            }
            resultsDiv.innerHTML = linkSet;
       },
     _pageChangedHandler: function(sender,args)
     {
        //Reconstruct the latest result set.
        this._currentPage = args.get_currentPage();
        this._getCurrentList("");
     },
     _getCurrentList: function(callType)
     {        
        var results = this.get_results();
        var res=new Array();
        var iy =0;
        for(iz=(this._currentPage*5) - 4;iz<=results.length;iz++)
        {
            res[iy++] = results[iz-1];
            if((iy-1)==5)break;
        }
        this._constructList(res,callType);
     },
    _clearComponents: function()
    {
        for(var a in this._components)
        {
            delete this._components[a];
        }
    },
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))
            this._components[e.get_id()] = e;
    },
    getComponents:function()
    {
        var a=[];b= this._components;
        for(var c in b)
        {
            a[a.length] = b[c];
        }
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}

Insp.UI.WeatherMultipleResults.registerClass('Insp.UI.WeatherMultipleResults',Sys.UI.Control);

ClientAccuWeather = 
{          
    ExpandPanel: function(obj)
    {
        var topObj = GetModuleTop(obj);
        var subPanel = GetObjectInModule(topObj,'DIV','morePanel');
        var expImg = GetObjectInModule(topObj,'IMG','expandImg');
        var expText = GetObjectInModule(topObj,'SPAN','showmore');
        if(subPanel.style.display == "block")
        {
            expImg.src = '01_max.gif';
            expText.innerHTML = 'Show more';
            subPanel.style.display = "none";
        }
        else
        {
            expImg.src = '01_min.gif';
            expText.innerHTML = 'Show less';
            subPanel.style.display = "block";
        } 
    },
    
    
    SwitchTabs: function(cell,type)
    {
        var topObj = GetModuleTop(cell);
        var floatPanel = GetObjectInModule(topObj,'DIV','floatingDiv');
        var fcstTab = GetObjectInModule(topObj,'DIV','tabForecast');
        var radarTab = GetObjectInModule(topObj,'DIV','tabNational');
        var tempTab = GetObjectInModule(topObj,'DIV','tabTemperature');
        var fcstArr = GetObjectInModule(topObj,'DIV','fcstArray');
        var prt = GetObjectInModule(topObj,'DIV','subDiv');
        switch(type)
        {
            case 'F':
                     fcstTab.className='tabcellSelected';
                     radarTab.className='tabcellUnSelected';
                     tempTab.className='tabcellUnSelected';
                     if(ClientAccuWeather.ShowPanel(topObj,'F'))
                     {
                        $create(Insp.UI.AccuWeather.ForecastPanel,{forecastDetails:fcstArr.innerHTML},null,{parent:prt},floatPanel);  
                     }
                     break;
            case 'N':
                     fcstTab.className='tabcellUnSelected';
                     radarTab.className='tabcellSelected';
                     tempTab.className='tabcellUnSelected';
                     if(ClientAccuWeather.ShowPanel(topObj,'N'))
                     {
                        $create(Insp.UI.AccuWeather.RadarPanel,{},null,{parent:prt},floatPanel);  
                     }
                     break;
            case 'T':
                     fcstTab.className='tabcellUnSelected';
                     radarTab.className='tabcellUnSelected';
                     tempTab.className='tabcellSelected';
                     if(ClientAccuWeather.ShowPanel(topObj,'T'))
                     {
                        $create(Insp.UI.AccuWeather.TempPanel,{},null,{parent:prt},floatPanel);  
                     }                    
                     break;
        }
    },
    
    ChangeRadarUrl: function(link,type)
    {
        
        var urlSet = null;
        var isBlank = false;
        var topObj = GetModuleTop(link);
        var localLink = GetObjectInModule(topObj,'span','lnkLocal');
        var stateLink = GetObjectInModule(topObj,'span','lnkState');
        var satelliteLink = GetObjectInModule(topObj,'span','lnkSatellite');
        var radarMap = GetObjectInModule(topObj,'img','imgRadarMap');
        var radarUrl = GetObjectInModule(topObj,'div','radarUrl').innerHTML;
        if(radarUrl != null)
	    {
	        if(radarUrl.indexOf('|') > 0)
	        {
	            urlSet = radarUrl.split('|');
	        }
	    }
	    else
	    {
	        isBlank = true;
	    }
        switch(type)
        {
            case 'L':
                     localLink.className='radarSelectLink';
                     stateLink.className='radarUnSelectLink';
                     satelliteLink.className='radarUnSelectLink';
                     radarMap.src = ((isBlank || urlSet == null) ? "01_blank.GIF" : urlSet[0]);
                     break;    
            case 'ST':
                     localLink.className='radarUnSelectLink';
                     stateLink.className='radarSelectLink';
                     satelliteLink.className='radarUnSelectLink';
                     radarMap.src = ((isBlank || urlSet == null) ? "01_blank.GIF" : urlSet[1]);
                     break;    
            case 'SA':
                     localLink.className='radarUnSelectLink';
                     stateLink.className='radarUnSelectLink';
                     satelliteLink.className='radarSelectLink';
                     radarMap.src = ((isBlank || urlSet == null) ? "01_blank.GIF" : urlSet[2]);
                     break;    
                     
        }
    },
    
    ChangeTempUrl: function(link,type)
    {
        var topObj = GetModuleTop(link);
        var todLink = GetObjectInModule(topObj,'span','lnkToday');
        var tonLink = GetObjectInModule(topObj,'span','lnkTonight');
        var tomLink = GetObjectInModule(topObj,'span','lnkTomorrow');
        var tempMap = GetObjectInModule(topObj,'img','imgTempMap');
        switch(type)
        {
            case 'TY':
                     todLink.className='tmpSelectLink';
                     tonLink.className='tmpUnSelectLink';
                     tomLink.className='tmpUnSelectLink';
                     tempMap.src = "http://pics.mobile.infospace.com/dynpics/AccuWeather_images/en/other/320/todtemp.png";
                     break;    
            case 'TN':
                     todLink.className='tmpUnSelectLink';
                     tonLink.className='tmpSelectLink';
                     tomLink.className='tmpUnSelectLink';
                     tempMap.src = "http://pics.mobile.infospace.com/dynpics/AccuWeather_images/en/other/320/tomtemp.png";
                     break;    
            case 'TM':
                     todLink.className='tmpUnSelectLink';
                     tonLink.className='tmpUnSelectLink';
                     tomLink.className='tmpSelectLink';
                     tempMap.src = "http://pics.mobile.infospace.com/dynpics/AccuWeather_images/en/other/320/tontemp.png";
                     break;    
        }
    },
    
    DisplayError: function(obj,message)
    {
        obj.innerHTML = message;
        obj.style.display = "block";
    },
    
    ShowPanel: function(topObj,tab)
    {
        var fcstDiv = GetObjectInModule(topObj,'DIV','fcstDiv');
        var radarDiv = GetObjectInModule(topObj,'DIV','radarDiv');
        var tempDiv = GetObjectInModule(topObj,'DIV','tempDiv');
        switch(tab)
        {
            case 'F':
            if(typeof(fcstDiv) == 'undefined')return true;
            if(fcstDiv.style.display == 'none')
            {
                fcstDiv.style.display = 'block';
                if(typeof(radarDiv) != 'undefined')radarDiv.style.display = 'none';
                if(typeof(tempDiv) != 'undefined')tempDiv.style.display = 'none';
            }
            break;
            case 'N':
            if(typeof(radarDiv) == 'undefined')return true;
            if(radarDiv.style.display == 'none')
            {
                if(typeof(fcstDiv) != 'undefined')fcstDiv.style.display = 'none';
                radarDiv.style.display = 'block';
                if(typeof(tempDiv) != 'undefined')tempDiv.style.display = 'none';
            }
            break;
            case 'T':
            if(typeof(tempDiv) == 'undefined')return true;
            if(tempDiv.style.display == 'none')
            {
                if(typeof(fcstDiv) != 'undefined')fcstDiv.style.display = 'none';
                if(typeof(radarDiv) != 'undefined')radarDiv.style.display = 'none';
                tempDiv.style.display = 'block';
            }
            break;
        }
        return false;
    },
    SaveData: function(obj,city,state,postalcode,tempType,clientid,changetitle)
    {
        var city = obj.innerHTML;
        var cityState = null;
        var title = 'Weather';
        if(city.indexOf(',') > 0)
        {
            cityState = city.split(',');
            city = cityState[0].trim();
            state = cityState[1].trim();
             
            if(eval(changetitle))
            {
                title = "Weather: " + city + ", " + state;
            }
        }
        Portal.ClientAccuWeatherSvc.UpdateChanges(city,state,title,postalcode,tempType,clientid,ClientAccuWeather.saveSuccessHandler,ClientAccuWeather.saveFailHandler);    
    },
    saveSuccessHandler: function(res)
    {
        if(res == "success")
        {
            if(currModule != null)currModule.refreshModule();
        }
    },
    saveFailHandler: function()
    {
    }
}

// Since this script is not loaded by System.Web.Handlers.ScriptResourceHandler
// invoke Sys.Application.notifyScriptLoaded to notify ScriptManager 
// that this is the end of the script.
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

Type.registerNamespace("Insp");
Type.registerNamespace("Insp.UI");

Insp.UI.Widget = function(element)
{
    Insp.UI.Widget.initializeBase(this,[element]);
    this._url="";
    this._jsPrototype="";
    
    this._callbackDelegate = null;
    this._errorDelegate = null;
    this._jsExecDelegate = null;
}

Insp.UI.Widget.prototype = {
    get_url: function(){return this._url;},
    set_url: function(value){this._url = value;this.raisePropertyChanged('url');},
    
    get_jsPrototype: function(){return this._jsPrototype;},
    set_jsPrototype: function(value){this._jsPrototype = value;this.raisePropertyChanged('jsPrototype');},

    dispose: function()
    {
        if (this._callbackDelegate)delete this._callbackDelegate;
        if (this._errorDelegate)delete this._errorDelegate;
        if (this._jsExecDelegate)delete this._jsExecDelegate;
		Insp.UI.Widget.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.Widget.callBaseMethod(this,'initialize');
		this.addCssClass("ptModWidgt");
		this.addCssClass("moduleloading");
	
    	if (this._callbackDelegate === null) {
            this._callbackDelegate = Function.createDelegate(this, this.callbackHandler);
        }
        if (this._errorDelegate === null) {
            this._errorDelegate = Function.createDelegate(this, this._errorHandler);
        }
    	if (this._jsExecDelegate === null) {
            this._jsExecDelegate = Function.createDelegate(this, this._jsExecHandler);
        }
    },
    updated: function()
    {
        Portal.WidgetSvc.a(this.get_url(),this._callbackDelegate);
        Insp.UI.Widget.callBaseMethod(this,'updated');
    },
    callbackHandler: function(results)
    {
		if(results !== '')
		{
			this.removeCssClass("moduleloading");
			this.get_element().innerHTML = results;
			var d = this.get_element().getElementsByTagName("script");
			var t=d.length;
			for (var i=0;i<t;i++){
				var newScript = document.createElement('script');
				newScript.type = "text/javascript";
				newScript.text = d[i].text;
				if (d[i].src != '')
					newScript.src = d[i].src;
				this.get_element().appendChild (newScript);
			}
	        
			if(this.get_jsPrototype().length > 0)
			{
				window.setTimeout(this._jsExecDelegate,1000);
			}
		}else
			this._errorHandler();
    },
    _errorHandler: function(results)
    {
		this.removeCssClass("moduleloading");
		this.get_element().innerHTML = "<div style='margin:0;padding:1em 0;text-align:center;' class='feedErrorMessage'>"+widgetErrStr+"</div>";
    },
    _jsExecHandler: function()
    {
        obj = eval(this.get_jsPrototype());
        if(obj)obj.Execute(this.get_element());
    }
}
Insp.UI.Widget.registerClass('Insp.UI.Widget',Insp.UI.ModuleContentCtl);

if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
Type.registerNamespace("Insp");
Type.registerNamespace("Insp.UI");

Insp.UI.PopSearchList = function(element)
{
    Insp.UI.PopSearchList.initializeBase(this,[element]);
    this._feedSuccessDelegate = null;
    this._feedFailureDelegate = null;
    this._searchDelegate = null;
    this._popSearchURL = "";
    this._searchURL = "";
    this._target = "";
    this._itemCount = 6;
    this._showSearchBox = true;
}

Insp.UI.PopSearchList.prototype = 
{

    get_popSearchURL:function(){return this._popSearchURL;},
    set_popSearchURL:function(value){this._popSearchURL = value;this.raisePropertyChanged('popSearchURL');},
    
    get_searchURL:function(){return this._searchURL;},
    set_searchURL:function(value){this._searchURL = value;this.raisePropertyChanged('searchURL');},
    
    get_itemCount:function(){return this._itemCount;},
    set_itemCount:function(value){this._itemCount = value;this.raisePropertyChanged('itemCount');},
    
    get_showSearchBox:function(){return this._showSearchBox;},
    set_showSearchBox:function(value){this._showSearchBox = value;this.raisePropertyChanged('showSearchBox');},
    
    get_target:function(){return this._target;},
    set_target:function(value){this._target = value;this.raisePropertyChanged('target');},
    
    initialize: function()
    {
        Insp.UI.PopSearchList.callBaseMethod(this,"initialize");
        var e = this.get_element();
        Sys.UI.DomElement.addCssClass(e, "ptModPopSearch");
        
        var sb = $get("SearchBoxCell",this.get_element());
        if(this.get_showSearchBox())sb.style.display="";
        else sb.style.display="none";
        
        if(this._feedSuccessDelegate === null)
            this._feedSuccessDelegate = Function.createDelegate(this, this._feedSuccess);
            
        if(this._feedFailureDelegate === null)
            this._feedFailureDelegate = Function.createDelegate(this, this._feedFailure);
            
        if(this._searchDelegate === null)
            this._searchDelegate = Function.createDelegate(this, this._searchHandler);
        $addHandler($get('SearchBtn',this.get_element()),'click',this._searchDelegate);
     },
    dispose: function()
    {
        $removeHandler($get('SearchBtn',this.get_element()),'click',this._searchDelegate);
        if(this._searchDelegate) delete this._searchDelegate;     
        if(this._feedSuccessDelegate) delete this._feedSuccessDelegate;     
        if(this._feedFailureDelegate) delete this._feedFailureDelegate;     
       Insp.UI.PopSearchList.callBaseMethod(this,"dispose");   
    },
    updated: function()
    {
        Portal.ClientRssSvc.GetDetails(this.get_popSearchURL(), 1,6,this._feedSuccessDelegate,this._feedFailureDelegate);
    },
    _feedSuccess:function(results)
    {
        this._populateList(results);
    },
    _feedFailure:function()
    {
        
    },
    _populateList:function(results)
    {
        for(var i=0;i<results.length;i++)
        {
            var oa = results[i].ArtHeadline;
            this._addWordToList(oa,i);
        }
    },
    _addWordToList:function(word,idx)
    {
        var klist = $get("KeywordList",this.get_element());
        var li = document.createElement('li');
        li.innerHTML = '<span class="bullet"><small>&#9632;&nbsp;</small></span><a target="' + this.get_target() + '" href="'+this.get_searchURL().replace(/\[SearchItem\]/ig,word)+'" onclick="LogClient(\'108\',\'portalmodule\');">'+word+'</a>';
        klist.appendChild(li);
    },
    _searchHandler:function(evt)
    {
        var searchText = $get('SearchTxt',this.get_element()).value;
        var errorDiv = $get('errorDiv',this.get_element());
        searchText = searchText.trim();
        evt.preventDefault();
        if(!searchText.length == 0)
        {      
              var modSearchTxt='';
              for(j=0;j<searchText.length;j++)
              {
                modSearchTxt+=SpecialCharacter(searchText.substring(j,j+1));
              }
              var finalUrl= this.get_searchURL().replace(/\[SearchItem\]/ig,modSearchTxt);
              window.open(finalUrl,this.get_target());
              errorDiv.style.display = "none";
              return true;             
        }
        else
        {
            errorDiv.innerHTML = "<span style=\"display: inline;\">Please enter valid values.Value should not be empty.</span>";
            errorDiv.style.display = "";
            return false;
        }
    }
}
Insp.UI.PopSearchList.registerClass('Insp.UI.PopSearchList',Sys.UI.Control);

// Since this script is not loaded by System.Web.Handlers.ScriptResourceHandler
// invoke Sys.Application.notifyScriptLoaded to notify ScriptManager 
// that this is the end of the script.
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

Type.registerNamespace("Insp");
Type.registerNamespace("Insp.UI");

Insp.UI.ClientHoro = function(element)
{    
    Insp.UI.ClientHoro.initializeBase(this,[element]);
    this._title = "";
    this._energy = true;
    this._showenergy = true;
    this._lite = false;
    this._sign="";
    this._startDate = "";
    this._startDate = "" ;
    this._endDate = "";
    this._presentdate="";
    this._copyrightyear = "";
    this._tabselected = "horo";
    this._todaysHoroscopeDescription = "";
    this._todaysDate = "";
    this._todaysDisplayDate = "";
    this._todaysHasPrevDay = false;
    this._todaysHasNextDay = false;
    this._horoimg = "";
    this._selecteddate="";
    this._selectedmonth = "";
    this._resultarray = null;//new Array();
    this.month_names = new Array("","January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");    
    this._horosign="";
    this._callbackDelegate = null;        
    this._callbackfailureDelegate = null;
    this._callbacksunshineDelegate = null;
    this._callbacksunshineFailureDelegate = null;
    
    this._leftnavigationDelegate = null;
    this._rightnavigationDelegate = null;
    
    this._horoClickdelegate = null;
    this._sunshineClickdelegate = null;
    
    
    this._components = [];    
}

Insp.UI.ClientHoro.prototype = {

    
    get_title: function(){ return this._title;},
    set_title: function(value){ this._title = value;this.raisePropertyChanged('title');},
    
    get_lite: function(){ return this._lite;},
    set_lite: function(value){ this._lite = value;this.raisePropertyChanged('lite');},

    get_energy: function(){return this._energy;},
    set_energy: function(value){this._energy = value;this.raisePropertyChanged('energy');},
   
    get_horoimg: function(){return this._horoimg;},
    set_horoimg: function(value){this._horoimg = value;this.raisePropertyChanged('horoimg');}, 
        
    get_showenergy: function(){return this._showenergy;},
    set_showenergy: function(value){this._showenergy = value;this.raisePropertyChanged('showenergy');},
    
    get_sign: function(){return this._sign;},
    set_sign: function(value){this._sign = value;this.raisePropertyChanged('sign');},
    
    get_startDate: function(){return this._startDate;},
    set_startDate: function(value){this._startDate = value;this.raisePropertyChanged('startDate');},
    
    get_endDate: function(){return this._endDate;},
    set_endDate: function(value){this._endDate = value;this.raisePropertyChanged('endDate');},
        
    get_presentdate: function(){return this._presentdate;},
    set_presentdate: function(value){this._presentdate = value;this.raisePropertyChanged('presentdate');},  
    
    
    //client horoscope related functions
    parseDate: function (date)
    {
        var daysplitarray = date.split("/");
        return parseInt(daysplitarray[1]);
    }, 
    
    parseMonth : function (date)
    {
        var daysplitarray = date.split("/");
        return this.month_names[parseInt(daysplitarray[0])].toString();
    },
    
    parseYear : function (date)
    {
        var daysplitarray = date.split("/");
        return daysplitarray[2];
    },
    
    formatDate: function(date)
    {
        var dt = new Date(date);
        dt = dt.format(strDateFormat);
        return strReading +" "+ dt;

    },
    populateDailyHoroscope : function ()
    {
        
        var boolElse = true; 
        var noFeed = true;
        for(var i=0; i< this._resultarray.length ; i++)
        {
            if(this._resultarray[i].date == this._presentdate)
            {
                noFeed = false;
                //Parse today's date, previous date and next date
                var tdate = this.parseDate(this._resultarray[i].date);
                var tmonth = this.parseMonth(this._resultarray[i].date);
                var tyear = this.parseYear(this._resultarray[i].date);
                
               
                if(this._resultarray[i].hasPrevDay && this._resultarray[i].hasNextDay && i < this._resultarray.length - 1 && i > 0)
                {
                    var previousdate = this.parseMonth(this._resultarray[i - 1].date) + " " + this.parseDate(this._resultarray[i - 1].date) + ",  " + this.parseYear(this._resultarray[i - 1 ].date);
                    var presentdate = this._resultarray[i].displayDate;
                    var nextdate = this.parseMonth(this._resultarray[i + 1].date) + " " + this.parseDate(this._resultarray[i + 1].date) + ",  " + this.parseYear(this._resultarray[i + 1].date);
                    //var temp = $get('horozeropaddingid', this.get_element());
                    //var test = temp;
                    $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span style='font-family:Arial;cursor:pointer' class='horoNavBtn' id='imgBtn_Previous' name='imgBtn_Previous'>&#9668;</span><span class='pagination'>" + presentdate + "</span><span style='font-family:Arial;cursor:pointer' class='horoNavBtn' id='imgBtn_Next' name='imgBtn_Next'>&#9658;</span></div></div>";
                    this.removeLeftNavigationHandler();
                    this.removeRightNavigationHandler();
                    this.addLeftNavigationHandler();
                    this.addRightNavigationHandler();
                    boolElse = false;
                    //alert(1);
                }
                if(this._resultarray[i].hasPrevDay && !this._resultarray[i].hasNextDay && i > 0)
                {
                    //write code for only left image    
                    var previousdate = this.parseMonth(this._resultarray[i - 1].date) + " " + this.parseDate(this._resultarray[i - 1].date) + ",  " + this.parseYear(this._resultarray[i - 1 ].date);
                    var presentdate = this._resultarray[i].displayDate;
                    $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span style='font-family:Arial;cursor:pointer' class='horoNavBtn' id='imgBtn_Previous' name='imgBtn_Previous'>&#9668;</span><span class='pagination'>" + presentdate + "</span></div></div>";
                    //this.removeLeftNavigationHandler();
                    //this.addLeftNavigationHandler();
                    
                    boolElse = false;
                    this.removeLeftNavigationHandler();
                    this.removeRightNavigationHandler();
                    this.addLeftNavigationHandler();
                    this.addRightNavigationHandler();
                    
                    //alert(2);

                }
                if(!this._resultarray[i].hasPrevDay && this._resultarray[i].hasNextDay && i < this._resultarray.length - 1)
                {
                    //write code for right image
                    var presentdate = this._resultarray[i].displayDate;
                    var nextdate = this.parseMonth(this._resultarray[i + 1].date) + " " + this.parseDate(this._resultarray[i + 1].date) + ",  " + this.parseYear(this._resultarray[i + 1].date);
                    $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span class='pagination'>" + presentdate + "</span><span style='font-family:Arial;cursor:pointer' class='horoNavBtn' id='imgBtn_Next' name='imgBtn_Next'>&#9658;</span></div></div>";
                    //this.removeRightNavigationHandler();
                    //this.addRightNavigationHandler();
                    boolElse = false;
                    
                    this.removeLeftNavigationHandler();
                    this.removeRightNavigationHandler();
                    this.addLeftNavigationHandler();
                    this.addRightNavigationHandler();
                    
                    //alert(3);
                }
                if(!this._resultarray[i].hasPrevDay && !this._resultarray[i].hasNextDay)
                {
                    //hide both images
                    var presentdate = this._resultarray[i].displayDate;
                    $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span class='pagination'>" + presentdate + "</span></div></div>";
                    //alert(4);
                    boolElse = false;
                } 
                
                if(boolElse)
                {
                    if(i == 0)
                    {
                        var presentdate = this._resultarray[i].displayDate;
                        var nextdate = this.parseMonth(this._resultarray[i + 1].date) + " " + this.parseDate(this._resultarray[i + 1].date) + ",  " + this.parseYear(this._resultarray[i + 1].date);
                        $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span class='pagination'>" + presentdate + "</span><span style='font-family:Arial;cursor:pointer' class='horoNavBtn' id='imgBtn_Next' name='imgBtn_Next'>&#9658;</span></div></div>";   
                    }
                    if(i == this._resultarray.length - 1)
                    {   
                        var previousdate = this.parseMonth(this._resultarray[i - 1].date) + " " + this.parseDate(this._resultarray[i - 1].date) + ",  " + this.parseYear(this._resultarray[i - 1 ].date);
                        var presentdate = this._resultarray[i].displayDate;
                        $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span style='font-family:Arial;cursor:pointer' class='horoNavBtn' id='imgBtn_Previous' name='imgBtn_Previous'>&#9668;</span><span class='pagination'>" + presentdate + "</span></div></div>";
                    }
                    
                    this.removeLeftNavigationHandler();
                    this.removeRightNavigationHandler();
                    this.addLeftNavigationHandler();
                    this.addRightNavigationHandler();
                }
                this._todaysHoroscopeDescription =  this._resultarray[i].description;   
                this._todaysDisplayDate =  this._resultarray[i].displayDate;   
                this._todaysHasPrevDay = this._resultarray[i].hasPrevDay;
                this._todaysHasNextDay = this._resultarray[i].hasNextDay;
                $get('horoimgSignTdId', this.get_element()).innerHTML = "<div id='horoStoryBodyID' class='horoStoryBody'>"+ this._resultarray[i].description+ "</div>";
                
                if(this.get_showenergy() && this.get_energy() && this._resultarray[i].energyLevel.toString() != '0')
                {                    
                    $get('hororowEnergyLineid', this.get_element()).innerHTML = "<hr/>";
                    $get('horoEnergyHeadingId', this.get_element()).innerHTML = "<div><h2 class='horoenergyheading' style='color:Black;'>"+strClientHoroscope_EnergyLvl+"</h2></div>";
                    var energyimage = this._resultarray[i].energyLevel.toString() + ".gif";
                    $get('horoEnergySummaryId', this.get_element()).innerHTML = "<div id='horodivEnergySummary'><table cellspacing='0' cellspadding='0' border='0' border-collapse='collapse'> <tr> <td class='horoenergybody' colspan='2'><div style='line-height:17px;'>"+strClientHoroscope_Relationships+"<br/>"+strClientHoroscope_Personal+"<br/>"+strClientHoroscope_WorkFinance+"</div> </td><td class='horoenergyImg'><div style='vertical-align:top;'><img id='imgEnergy' style='border-width:0px;' alt='Energy Level' src=" + energyimage+ " /></div></td></tr></table></div>";
                    $get('horoEnergyBottomId', this.get_element()).innerHTML = "<div>&copy;<a target='_blank' href='http://www.astrology.com'>Astrology.com</a> &#8482;1996 &#8211; <span>"+this.parseYear(this._copyrightyear)+ "</span> ."+strClientHoroscope_copyright+"</div>";
                }
                
            }
                           
        }
        if(this._resultarray.length == 1)
        {
           noFeed = false;
           var presentdate = this._resultarray[0].displayDate;
           
           $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span class='pagination'>" + presentdate + "</span></div></div>";
           
                this._todaysHoroscopeDescription =  this._resultarray[0].description;   
                this._todaysDisplayDate =  this._resultarray[0].displayDate;   
                this._todaysHasPrevDay = this._resultarray[0].hasPrevDay;
                this._todaysHasNextDay = this._resultarray[0].hasNextDay;
                $get('horoimgSignTdId', this.get_element()).innerHTML = "<div id='horoStoryBodyID' class='horoStoryBody'>"+ this._resultarray[0].description+ "</div>";
                
                if(this.get_showenergy() && this.get_energy() && this._resultarray[0].energyLevel.toString() != '0')
                {                    
                    $get('hororowEnergyLineid', this.get_element()).innerHTML = "<hr/>";
                    $get('horoEnergyHeadingId', this.get_element()).innerHTML = "<div><h2 class='horoenergyheading' style='color:Black;'>"+strClientHoroscope_EnergyLvl+"</h2></div>";
                    var energyimage = this._resultarray[0].energyLevel.toString() + ".gif";
                    $get('horoEnergySummaryId', this.get_element()).innerHTML = "<div id='horodivEnergySummary'><table cellspacing='0' cellspadding='0' border='0' border-collapse='collapse'> <tr> <td class='horoenergybody' colspan='2'><div style='line-height:17px;'>"+strClientHoroscope_Relationships+"<br/>"+strClientHoroscope_Personal+"<br/>"+strClientHoroscope_WorkFinance+"</div> </td><td class='horoenergyImg'><div style='vertical-align:top;'><img id='imgEnergy' style='border-width:0px;' alt='Energy Level' src=" + energyimage+ " /></div></td></tr></table></div>";
                    $get('horoEnergyBottomId', this.get_element()).innerHTML = "<div>&copy;<a target='_blank' href='http://www.astrology.com'>Astrology.com</a> &#8482;1996 &#8211; <span>"+this.parseYear(this._copyrightyear)+ "</span> ."+strClientHoroscope_copyright+"</div>";
                }
        }
        if(noFeed)
        {
            this.get_element().innerHTML = "<div id='horoscopeContainer' style='margin:0;padding:1em 0;text-align:center' class='feedErrorMessage'>"+strGenericError+"</div>";
            return;
        }

    },
    
    addLeftNavigationHandler : function()
    {
      try{
          
                this._leftnavigationDelegate  = Function.createDelegate(this, this.leftnavigationDelegateHandler);            
                $addHandler($get('imgBtn_Previous' ,this.get_element()),'click',this._leftnavigationDelegate);
      }catch(e)
      {
        //do nothing
      }
    },
    leftnavigationDelegateHandler : function()
    {        
        //debugger;
        var date = "";
        for (var i =0 ; i < this._resultarray.length ; i ++)
        {
            if(this._resultarray[i].date == this._presentdate && this._resultarray[i].hasPrevDay && i > 0)
            {   
                var x = i - 1;
                date = this._resultarray[x].date;
            }
        }
        this._presentdate = date;               
        this.populateDailyHoroscope();
    },
    
    addRightNavigationHandler : function()
    {
      try{
                this._rightnavigationDelegate  = Function.createDelegate(this, this.rightnavigationDelegateHandler);            
                $addHandler($get('imgBtn_Next' ,this.get_element()),'click',this._rightnavigationDelegate);
          
      }catch(e)
      {
        //do nothing
      }
    },
    
    rightnavigationDelegateHandler : function()
    {
        var temp = this._resultarray;
        var date = "";
        for (var i =0 ; i < this._resultarray.length ; i ++)
        {
            if(this._resultarray[i].date == this._presentdate && this._resultarray[i].hasNextDay && i < this._resultarray.length -1) 
            {
                var x = i + 1;
                date = this._resultarray[x].date;
            }
        }
        this._presentdate = date;
        this.populateDailyHoroscope();
    },
    
    removeLeftNavigationHandler : function()
    {
        try{
            $removeHandler($get('imgBtn_Previous',this.get_element()),'click',this._leftnavigationDelegate);
            if(this._leftnavigationDelegate) this._leftnavigationDelegate = null;
        }catch(e)
        {
            //do nothing
        }
    },
    
    removeRightNavigationHandler : function()
    {
        try{
            $removeHandler($get('imgBtn_Next',this.get_element()),'click',this._rightnavigationDelegate);
            if(this._rightnavigationDelegate) this._rightnavigationDelegate = null;
        }catch(e)
        {
            //do nothing
        }    
    },
        
    dispose: function()
    {
        if(this._callbackDelegate) delete this._callbackDelegate;
        //$removeHandler($get('featuredMoviesubmit',this.get_element()),'click',this._buttonClickDelegate);
        //if(this._buttonClickDelegate) delete this._buttonClickDelegate;
        
		Insp.UI.ClientHoro.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        
          Insp.UI.ClientHoro.callBaseMethod(this,'initialize');
 
          this._copyrightyear=this.get_presentdate();
 
          this.get_element().innerHTML = "<div id='horoscopeContainer' class='ptHoroClient'> " + 
          "<table cellspacing='0' cellspadding='0' border='0' border-collapse='collapse' class='horoBody'> " + 
            "<tr> <td class='horotdImage' id='horotdimageId'> </td></tr>" +
            "<tr><td id='horopaddingtabRowId' class='horopaddingtabrow' ></td> </tr>"+
            "<tr><td id='horozeropaddingid' class='horozeropadding' ></td> </tr>"+            
            "<tr><td class='horoimgSignTd' id='horoimgSignTdId'> </td></tr>" + 
            "<tr  ><td class='hororowEnergyLine'id='hororowEnergyLineid'></td></tr>"+
            "<tr > <td class='horozeropadding' id='horoEnergyHeadingId'></td></tr>" + 
            "<tr ><td class='horozeropadding' id='horoEnergySummaryId'></td></tr>" + 
            "<tr ><td class='horoEnergyBottom' id='horoEnergyBottomId'></td></tr>" + 
            "</table> </div>";
        
        this.addCssClass("ptHoroClient");
        this.addCssClass("HoroLoading");
		if (this._callbackDelegate === null) {
            this._callbackDelegate = Function.createDelegate(this, this.callbackHandler);
        }
        
        if (this._callbackfailureDelegate === null) {
            this._callbackfailureDelegate = Function.createDelegate(this, this.callbackfailureHandler);
        }
        if(this.get_lite())
        {
            $get('horopaddingtabRowId',this.get_element()).style.display='none';
        }
    },
    updated: function()
    {
        
          var sign = this.get_sign();
          var signsplit =  sign.split("(");
          var signname = signsplit[0].trim();
          this._horosign = signname;
          
          
        Portal.LightHoroscopeSvc.getClientDailyBySign(this._horosign, this.get_startDate(), this.get_endDate(),this._callbackDelegate,this._callbackfailureDelegate);
        Insp.UI.ClientHoro.callBaseMethod(this,'updated');
    },
    callbackHandler: function(results)
    {  	
        //debugger;
        //alert(results.length)
        this._resultarray = results;
        var temp = this._resultarray;
        this.removeCssClass("HoroLoading");
        //this._movieresult = results[0];
        this._clearComponents();
        this._createComponents();
    },
         
    callbackfailureHandler : function(failureresult)
    {
        this.get_element().innerHTML = "<div id='horoscopeContainer' style='margin:0;padding:1em 0;text-align:center' class='feedErrorMessage'>"+strGenericError+"</div>";
    },
        
    _createComponents: function()
    {    
    
      var temp = this._resultarray;
      if(temp == "" || temp == null)
      {
        this.get_element().innerHTML = "<div id='horoscopeContainer' style='margin:0;padding:1em 0;text-align:center' class='feedErrorMessage'>"+strGenericError+"</div>";
        return;
      } 
        $get('horotdimageId', this.get_element()).innerHTML = "<div> <img id='horoimgsign' class='horoImgSign' src='"+this.get_module().get_akamaiUrlPrefix()+this._horoimg+".gif"+this.get_module().get_akamaiUrlSuffix()+"'><span id='horosignname' class='horolabel_signname'>" + this._horosign + "</span> </div>";
        //Write a code for selection criteria
        if(this._tabselected == "horo")
        {
            $get('horopaddingtabRowId', this.get_element()).innerHTML = "<div style='padding-left: 8px; margin-right: 8px;' class='tabbutton tabstyle'><DIV id='dailyHoroscopeId' class='tabbutton_on' style='white-space:nowrap;'><DIV class='tabbutton_left'></DIV><SPAN><a>"+strClientHoroscope_DailyHoroscope+"</a></SPAN><DIV class='tabbutton_right'></DIV></DIV><DIV id='sunshineProfileId' class='tabbutton_off' style='white-space:nowrap;'><DIV class='tabbutton_left'></DIV><SPAN><a>"+strClientHoroscope_SunShine+"</a></SPAN><DIV class='tabbutton_right'></DIV></DIV></div>";        
        //check for three condition has previous, has next and has both 
            this._todaysDate = this._presentdate;
            this.populateDailyHoroscope();
        }  
        else
        {
            //write code for else part
        }
      
      //Adding handler to both the divs
      if(this._horoClickdelegate  === null)  
      {
            this._horoClickdelegate  = Function.createDelegate(this, this.horoClickdelegateHandler);            
            $addHandler($get('dailyHoroscopeId' ,this.get_element()),'click',this._horoClickdelegate);
      }
      
      if(this._sunshineClickdelegate  === null)  
      {
            this._sunshineClickdelegate  = Function.createDelegate(this, this.sunshineClickdelegateHandler);            
            $addHandler($get('sunshineProfileId' ,this.get_element()),'click',this._sunshineClickdelegate);
      }
      
      if (this._callbacksunshineDelegate === null) {
            this._callbacksunshineDelegate = Function.createDelegate(this, this.callbacksunshineDelegateHandler);
        }
        
        if (this._callbacksunshinefailureDelegate === null) {
            this._callbacksunshinefailureDelegate = Function.createDelegate(this, this.callbacksunshineDelegatefailureHandler);
        }
      
    },
    
    horoClickdelegateHandler : function()
    {
        if(this._tabselected == "horo")
        {
            //do nothing
        }else
        {
            
            this.removeLeftNavigationHandler();
            this.removeRightNavigationHandler();
        
            this._tabselected = "horo";
            var previousdate = this.parseMonth(this._todaysDate) + " " + this.parseDate(this._todaysDate) + ",  " + this.parseYear(this._todaysDate);
            var presentdate = this._todaysDisplayDate;
            var nextdate = this.parseMonth(this._todaysDate) + " " + this.parseDate(this._todaysDate) + ",  " + this.parseYear(this._todaysDate);
            $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'><div class='horoheader'><span id='imgBtn_Previous' style='font-family:Arial;cursor:pointer' class='horoNavBtn' name='imgBtn_Previous'>&#9668;</span><span class='pagination'>" + presentdate + "</span><span id='imgBtn_Next' name='imgBtn_Next' style='font-family:Arial;cursor:pointer'>&#9658;</span></div></div>";   
            $get('horoimgSignTdId', this.get_element()).innerHTML = "<div id='horoStoryBodyID' class='horoStoryBody'>"+ this._todaysHoroscopeDescription + "</div>";
            
            $get('imgBtn_Next', this.get_element()).style.display = (!this._todaysHasNextDay)?"none":"";
            $get('imgBtn_Previous', this.get_element()).style.display = (!this._todaysHasPrevDay)?"none":"";
            
            $get('dailyHoroscopeId', this.get_element()).className = "tabbutton_on";//
            $get('sunshineProfileId', this.get_element()).className = "tabbutton_off";
            
            //this._presentdate = this._todaysDate;
            this.removeLeftNavigationHandler();
            this.removeRightNavigationHandler();
            this.addLeftNavigationHandler();
            this.addRightNavigationHandler();
            
        }        
    },
    
    sunshineClickdelegateHandler : function()
    {
        if(this._tabselected == "horo")
        {   
            //Call web service to get sunshine long text
            Portal.LightHoroscopeSvc.getClientSunShineProfile(this._horosign,this._callbacksunshineDelegate,this._callbacksunshineDelegate);
        }else
        {
            //do nothing
        }
    },
    
    callbacksunshineDelegateHandler : function(sunshineresults)
    {
        
        //this.removeLeftNavigationHandler();
        //this.removeRightNavigationHandler();
        
        this._tabselected = "sunshine";
        var catstr="";
        catstr = (sunshineresults.dateRange!= "")?catstr + " (" + sunshineresults.dateRange + ")" : catstr;
        $get('horozeropaddingid', this.get_element()).innerHTML = "<div class='horotdImage'> <span style='font-weight:bold'>" +this._horosign+catstr+"</span></div>";
        var sunshineLongText = sunshineresults.longText.trim();
        $get('horoimgSignTdId', this.get_element()).innerHTML = "<div id='horoStoryBodyID' class='horoStoryBody'>"+ sunshineLongText+ "</div>";
        
        $get('dailyHoroscopeId', this.get_element()).className = "tabbutton_off";
        $get('sunshineProfileId', this.get_element()).className = "tabbutton_on";
        
        //this.addLeftNavigationHandler();
        //this.addRightNavigationHandler();
    },
    callbacksunshineDelegatefailureHandler : function()
    {
        //error condition
    },
    
    _clearComponents: function()
    {
        for(var a in this._components)
        {
            delete this._components[a];
        }
    },
    
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))
            this._components[e.get_id()] = e;
    },
    getComponents:function()
    { 
        var a=[];b= this._components;
        for(var c in b)
        {
            a[a.length] = b[c];
        }
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}

Insp.UI.ClientHoro.registerClass('Insp.UI.ClientHoro',Insp.UI.ModuleContentCtl,Sys.IContainer);


//Edit part code
Insp.UI.ClientHoroscopeParmsEdit = function(element)
{
    Insp.UI.ClientHoroscopeParmsEdit.initializeBase(this,[element]);
    
    this._title = "";
    this._showenergy = true;
    this._energy = true;
    this._lite = true;        
    this._sign="";    
    this._moduleClientID = null;
    this._signList =null;
    
//    this._saveBtnAnimation = null;
    this.horoscope = new Array("",strClientHoroscope_HoroscopeAries,strClientHoroscope_HoroscopeTaurus,strClientHoroscope_HoroscopeGemini,strClientHoroscope_HoroscopeCancer,strClientHoroscope_HoroscopeLeo,strClientHoroscope_HoroscopeVirgo,strClientHoroscope_HoroscopeLibra,strClientHoroscope_HoroscopeScorpio,strClientHoroscope_HoroscopeSagittarius,strClientHoroscope_HoroscopeCapricorn,strClientHoroscope_HoroscopeAquarius,strClientHoroscope_HoroscopePisces);
    this.signdates = new Array("",strClientHoroscope_Aries,strClientHoroscope_Taurus,strClientHoroscope_Gemini,strClientHoroscope_Cancer,strClientHoroscope_Leo,strClientHoroscope_Virgo,strClientHoroscope_Libra,strClientHoroscope_Scorpio,strClientHoroscope_Sagittarius,strClientHoroscope_Capricorn,strClientHoroscope_Aquarius,strClientHoroscope_Pisces);
    this._signCallbackDelegate = null;
    this._saveClickDelegate = null;
    this._headlineOnlyClickDelegate = null;
    this._showDetailClickDelegate = null;
    this._cancelClickDelegate = null;
    this._saveCallbackSuccessDelegate = null;
    this._saveCallbackFailureDelegate = null;        
}

Insp.UI.ClientHoroscopeParmsEdit.prototype = {
    get_title: function(){ return this._title;},
    set_title: function(value){ this._title = value;this.raisePropertyChanged('title');},
    
    get_showenergy: function(){return this._showenergy;},
    set_showenergy: function(value){this._showenergy = value;this.raisePropertyChanged('showenergy');},
    
    get_energy: function(){return this._energy;},
    set_energy: function(value){this._energy = value;this.raisePropertyChanged('energy');},

    get_lite: function(){ return this._lite;},
    set_lite: function(value){ this._lite = value;this.raisePropertyChanged('lite');},
    
    get_sign: function(){return this._sign;},
    set_sign: function(value){this._sign = value;this.raisePropertyChanged('sign');},
    
    get_saveBtnID: function(){return this._saveBtnID;},
    set_saveBtnID: function(value){this._saveBtnID = value;this.raisePropertyChanged('saveBtnID');},

    get_cancelBtnID: function(){return this._cancelBtnID;},
    set_cancelBtnID: function(value){this._cancelBtnID = value;this.raisePropertyChanged('cancelBtnID');},

    get_updatePanelID: function(){return this._updatePanelID;},
    set_updatePanelID: function(value){this._updatePanelID = value;this.raisePropertyChanged('updatePanelID');},

    get_moduleClientID: function(){return this._moduleClientID;},
    set_moduleClientID: function(value){this._moduleClientID = value;this.raisePropertyChanged('moduleClientID');},
    
    
    
    dispose: function()
    {
        //dffa

    },
    initialize: function()
    {
        
        Insp.UI.ClientHoroscopeParmsEdit.callBaseMethod(this,'initialize');
        if(this.get_lite() || !this.get_showenergy())
        {
            $get("energyOptDiv",this.get_element()).style.display='none';
        }        
        if (this._signCallbackDelegate === null) {
            this._signCallbackDelegate = Function.createDelegate(this, this._signCallbackHandler);
        }
        
        if (this._cancelClickDelegate === null) {
            this._cancelClickDelegate = Function.createDelegate(this, this._cancelClickHandler);
        }
        $addHandler($get('BtnCancel',this.get_element()),'click',this._cancelClickDelegate);
        
        if (this._saveClickDelegate === null) {
            this._saveClickDelegate = Function.createDelegate(this, this._saveClickHandler);
        }
        $addHandler($get('BtnSave',this.get_element()),'click',this._saveClickDelegate);
        
        if (this._saveCallbackSuccessDelegate === null) {
            this._saveCallbackSuccessDelegate = Function.createDelegate(this, this._saveCallbackSuccessHandler);
        }
        
        if (this._saveCallbackFailureDelegate === null) {
            this._saveCallbackFailureDelegate = Function.createDelegate(this, this._saveCallbackFailureHandler);
        }
        
    },    
    updated: function()
    {
        Portal.LightHoroscopeSvc.getSigns(this._signCallbackDelegate);
        Insp.UI.ClientHoroscopeParmsEdit.callBaseMethod(this,'updated');
    },
    
    _cancelClickHandler: function(eventObj)
    {
        this.get_module().set_showEditPart(false);
        this._initValues();
    },
    
    _initValues : function()
    {
        $get("CheckboxShowTooltip",this.get_element()).checked = this.get_energy();
        $get("SelSign",this.get_element()).value = this.get_sign();
    },
    
    _signCallbackHandler : function(results)
    {
        if(results != null && results.length > 0)
        {
            this._signList = results;
            var oSC=$get("SelSign",this.get_element());
            for(var i=0;i<results.length;i++)
            {
                var oOPT = document.createElement('OPTION');;
                oOPT.value = results[i].signCode;
                var catstr = results[i].signName.replace(/_/g," ");
                catstr =(results[i].beginDate!= "" && results[i].endDate!= "" )?catstr + " (" + results[i].beginDate + " - " + results[i].endDate + ")" : catstr;
                catstr = (results[i].dateRange!= "")?catstr + " (" + results[i].dateRange + ")" : catstr;
                oOPT.innerHTML = catstr;
                oSC.appendChild(oOPT);
            }
        }
        $get("CheckboxShowTooltip",this.get_element()).checked = this.get_energy();
        $get("SelSign",this.get_element()).value = this.get_sign();
    },
    _saveClickHandler: function(eventObj)
    {
        var sign = $get("SelSign",this.get_element()).value;  
        var horoscopefor = $get("SelSign",this.get_element()).value;  
        
        if(this._signList != null)
        {
            for(var i =0;i<this._signList.length;i++ )
            {
                if(this._signList[i].signCode == sign)
                {
                    horoscopefor = this._signList[i].signName;
                    break;
                }
            }
        }
        var energy = $get("CheckboxShowTooltip",this.get_element()).checked;        
        
        $get('BtnSave',this.get_element()).disabled=true;
        Portal.LightHoroscopeSvc.saveConfig(sign,energy,horoscopefor,this.get_moduleClientID(),this._saveCallbackSuccessDelegate,this._saveCallbackFailureDelegate);
    },
     _saveCallbackSuccessHandler: function(result)
    {
        
        if(result == "success")
        {
            if(this.get_module())this.get_module().refreshModule();
            this.get_module().set_showEditPart(false);
        }
    },
    _saveCallbackFailureHandler: function()
    {
         alert("in failed");
         $get('BtnSave',this.get_element()).disabled=false;
        
    }
}

Insp.UI.ClientHoroscopeParmsEdit.registerClass('Insp.UI.ClientHoroscopeParmsEdit',Insp.UI.ModuleEditCtl);



if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

Type.registerNamespace("Insp");
Type.registerNamespace("Insp.UI");

Insp.UI.ClientMovie = function(element)
{    
    Insp.UI.ClientMovie.initializeBase(this,[element]);
    this._title = "";
    this._contentRating = "";
    this._pageNum=0;
    this._responseperpage=0;
    this._releasestatus="";
    this._sortmode="";
    this._numShowtimeresponse = 0;
    
    this._moviename="";
    this._buttonClickDelegate=null;
    this._buttonfeatMovieCloseClickDelegate = null;
    this._keyPressDelegate=null;
    this._showtimeresult=null;
    this._movieid =""; 
    this._movieresult=null;  
    this._showtimeresultDelegate=null;      
    this._callbackDelegate = null;
    this._failureDelegate = null;       
    //this._innerdivClickDelegate  = [];  
     this._innerdivClickDelegate  = new Array();  
    this._components = [];    
}

Insp.UI.ClientMovie.prototype = {
    get_title: function(){ return this._title;},
    set_title: function(value){ this._title = value;this.raisePropertyChanged('title');},
    
    get_contentRating: function(){return this._contentRating;},
    set_contentRating: function(value){this._contentRating = value;this.raisePropertyChanged('contentRating');},
    
    get_pageNum: function(){return this._pageNum;},
    set_pageNum: function(value){this._pageNum = value;this.raisePropertyChanged('pageNum');},
    
    get_pageNum: function(){return this._pageNum;},
    set_pageNum: function(value){this._pageNum = value;this.raisePropertyChanged('pageNum');},
    
    get_responseperpage: function(){return this._responseperpage;},
    set_responseperpage: function(value){this._responseperpage = value;this.raisePropertyChanged('responseperpage');},
    
    get_releasestatus: function(){return this._releasestatus;},
    set_releasestatus: function(value){this._releasestatus = value;this.raisePropertyChanged('releasestatus');},
    
    get_sortmode: function(){return this._sortmode;},
    set_sortmode: function(value){this._sortmode = value;this.raisePropertyChanged('sortmode');},
    
    get_numShowtimeresponse: function(){return this._numShowtimeresponse;},
    set_numShowtimeresponse: function(value){this._numShowtimeresponse = value;this.raisePropertyChanged('numShowtimeresponse');},
    
    dispose: function()
    {
        if(this._callbackDelegate) delete this._callbackDelegate;
        var sb = $get('featuredMoviesubmit',this.get_element());
        if(sb)$removeHandler(sb,'click',this._buttonClickDelegate);
        
        if(this._buttonClickDelegate) delete this._buttonClickDelegate;
        
		Insp.UI.ClientMovie.callBaseMethod(this,'dispose');
    },
    initialize: function()
    {
        Insp.UI.ClientMovie.callBaseMethod(this,'initialize');
				
        //Create a div and table for movie module
        
        this.get_element().innerHTML = "<div id='errorDiv' class='feedErrorMessage' style='display:none;'>"+strClientMovieFeatured_FeedErrMsg+"</div>" +
        "<div id='moviecontainer' class='ptMovieClient'>" +
            "<table cellspacing='0' cellspadding='0' border='0' border-collapse: collapse> <tr> <td> <table cellspacing='0' cellspadding='0' border='0' border-collapse: collapse><tr><td id='movieinfo'></td></tr><tr><td class='movoffwebmargintop'><div id='movieofficialwebsite'/></td></tr><tr><td class='movtrailormarginbottom'><div id='movietrailer'/></td></tr></table></td></tr>" +
            "<tr><td style='height:auto'><div id='theatershowing' class='theatershowing'/></td></tr><tr><td><div id='findshowitme'/></td></tr></table></div>";
        
        this.addCssClass("ptMovieClient");
        this.addCssClass("FMLoading");
		if (this._callbackDelegate === null) {
            this._callbackDelegate = Function.createDelegate(this, this.callbackHandler);
        }
        if (this._failureDelegate === null) {
            this._failureDelegate = Function.createDelegate(this, this._failureHandler);
        }        
    },
    updated: function()
    {
        Portal.MovieShowTimesSvc.featuredMovieOrLatestMovie(this.get_contentRating(), this.get_pageNum(), this.get_responseperpage(), this.get_releasestatus(), this.get_sortmode(), this._callbackDelegate,this._failureDelegate);
        Insp.UI.ClientMovie.callBaseMethod(this,'updated');
    },
    callbackHandler: function(results)
    {  	
        this.removeCssClass("FMLoading");
        if(results.length <=0)
        {
            this._showErrorMsg();
        }else{
            this._movieresult = results[0];
            this._clearComponents();
            this._createComponents();
        }
    },
    _failureHandler:function()
    {
        this._showErrMsg();
    },
    _showErrorMsg:function()
    {
        var ed = $get("errorDiv",this.get_element());
        if(ed)ed.style.display="block";
        var mc = $get("moviecontainer",this.get_element());
        if(mc)mc.style.display="none";
    },     
    buttonClickDelegateHandler: function()
    {  
        if($get('featuredMovieinputzipcode',this.get_element()).value != ""){
            if(this._showtimeresultDelegate === null){ 
                this._showtimeresultDelegate = Function.createDelegate(this, this.showtimeresultDelegateHandler);        
                Portal.MovieShowTimesSvc.featuredMovieTheaterListOrTheaterList($get('featuredMovieinputzipcode',this.get_element()).value, this.get_pageNum(), this.get_numShowtimeresponse(),this._movieid, this._showtimeresultDelegate);
                $get('errmsg', this.get_element()).style.display = "none";
            }    
         }
         else
         {
            $get('theatershowing', this.get_element()).innerHTML = "<div class='hline'/>";
            var errorMsg = strClientMovieFeatured_ErrMsg;
            $get('errmsg', this.get_element()).innerHTML = "<br><br/>" +errorMsg; 
            $get('errmsg', this.get_element()).style.display = "block";
            
         }       
    },   
     
    
    showtimeresultDelegateHandler: function(showtimeresults)
    {   
       if(showtimeresults.length > 0){     //if started
        var featuredMovieinputzipcodeTemp = $get('featuredMovieinputzipcode',this.get_element()).value;
        this._showtimeresult = showtimeresults;
        $get('theatershowing', this.get_element()).innerHTML = "<div class='hline'/>";
        var innerHtml =  $get('theatershowing', this.get_element()).innerHTML;
        innerHtml = innerHtml + "<img src='icon_close_section.gif' id='featMovieCloseIcon' class='ptImgClose'>" + "<div class='tsTitle'>" + strClientMovieFeatured_TtrShow+" " +  '"' + this._moviename + '"' + " "+strClientMovieFeatured_Near+" " +featuredMovieinputzipcodeTemp+ "</div>" ;
        $get('theatershowing', this.get_element()).innerHTML = innerHtml;
        var innerdiv = "";
        for(var i = 0 ; i < showtimeresults.length ; i ++)
        {               
            var innerdivid = "min_max_small" + i;
            var innerdivaddress = "address_icon_min_max_small" + i;
            var innersrcid = "icon_min_max_small" + i;  
            innerdiv = innerdiv  + "<br><div id=" + "'" + innerdivid + "'" + "><span id=" + "'" + i + "'" + " class='theatername'> <span class='arrow' id=" + "'" + innersrcid + "'" + ">&#9658;</span> " + this._showtimeresult[i].theaterNameforC + 
            "</span><br>" + "<div class='theatermovieshowing'>" +this._showtimeresult[i].theaterShowingforC +" </div>" + "</div>" + "<div id=" + "'" + innerdivaddress + "'" + " class='innerdivaddress'>" +this._showtimeresult[i].theaterLocationforC + "</div>";                
            
            
            
        }
        innerHtml = innerHtml + innerdiv + "<div class='hline'/>";
        $get('theatershowing', this.get_element()).innerHTML = innerHtml;
        
        
        $get('featuredMovieinputzipcode',this.get_element()).value = "";
        
        
        //Adding handlers
        
        for(var i = 0 ; i < showtimeresults.length ; i ++)    
        { 
          
          this._innerdivClickDelegate [i] = null;     
          var innerdivid = "min_max_small" + i;
          if(this._innerdivClickDelegate[i]  === null)  
          {
            this._innerdivClickDelegate[i]  = Function.createDelegate(this, this.innerdivClickDelegateHandler);            
            $addHandler($get(innerdivid ,this.get_element()),'click',this._innerdivClickDelegate [i]);
          }
        }
       } //end of if 
       else
       {
            var featuredMovieinputzipcodeTemp = $get('featuredMovieinputzipcode',this.get_element()).value;   
            $get('theatershowing', this.get_element()).innerHTML = "<div class='hline'/>";
            var innerHtml =  $get('theatershowing', this.get_element()).innerHTML;
            innerHtml = innerHtml + "<img src='icon_close_section.gif' id='featMovieCloseIcon' class='ptImgClose'>" + "<div class='error'>"+strClientMovieFeatured_MvNotFnd+" " +featuredMovieinputzipcodeTemp +"</div>" ;
            innerHtml = innerHtml + "<div class='hline'/>";
            $get('theatershowing', this.get_element()).innerHTML = innerHtml;
        
        
            $get('featuredMovieinputzipcode',this.get_element()).value = "";
         
       } 
         if (this._buttonfeatMovieCloseClickDelegate === null) 
          {
            this._buttonfeatMovieCloseClickDelegate = Function.createDelegate(this, this.buttonfeatMovieCloseClickDelegateHandler);
          }
          $addHandler($get('featMovieCloseIcon',this.get_element()),'click',this._buttonfeatMovieCloseClickDelegate);
          
        this._showtimeresultDelegate = null;
    },
    innerdivClickDelegateHandler : function (position)
    {   
                
         var currIcon = "" ;
         if((position.target.id.toString()) == "")return;
         if((position.target.id.toString()).indexOf("icon_min_max_small") != -1)
         {
            currIcon = position.target.id.toString();
         }
         else if((position.target.id.toString()).indexOf("min_max_small") != -1)
         {
            currIcon = "icon_" + position.target.id.toString();
         }
         else
         {
            currIcon = "icon_min_max_small" + position.target.id;
         }
          var currAddress = "address_" + currIcon;
         if(($get( currAddress, this.get_element()).style.display == "none" ) || ($get( currAddress, this.get_element()).style.display == ""))
         {
           
           
             $get( currIcon, this.get_element()).innerHTML = "&#9660;";
            $get( currAddress, this.get_element()).style.display = "block";
            
         }else
         {
             $get( currIcon, this.get_element()).innerHTML = "&#9658";           
            $get( currAddress, this.get_element()).style.display = "none";
            
         }         
    },
   
    
    buttonfeatMovieCloseClickDelegateHandler: function()
    {
        $get('theatershowing', this.get_element()).innerHTML = "<div class='hline'/>";
    }, 
     
    keyPressDelegateHandler:function(key)
    {
        if(key.rawEvent.keyCode == "13"){        
            if($get('featuredMovieinputzipcode',this.get_element()).value != ""){
              if(this._showtimeresultDelegate === null){            
                this._showtimeresultDelegate = Function.createDelegate(this, this.showtimeresultDelegateHandler);        
                Portal.MovieShowTimesSvc.featuredMovieTheaterListOrTheaterList($get('featuredMovieinputzipcode',this.get_element()).value, this.get_pageNum(), this.get_numShowtimeresponse(),this._movieid, this._showtimeresultDelegate);
                $get('errmsg', this.get_element()).style.display = "none";
              }  
             }else
             {
                $get('theatershowing', this.get_element()).innerHTML = "<div class='hline'/>";
                var errorMsg = strClientMovieFeatured_ErrMsg;
                $get('errmsg', this.get_element()).innerHTML = "<br><br/>" +errorMsg; 
                $get('errmsg', this.get_element()).style.display = "block";
             }   
        }
     }, 
        
    _createComponents: function()
    {            
          this._moviename = this._movieresult.movieNameforC;
          this._movieid=this._movieresult.movieIDforC;  
          //Check for banner image
          var arrLoc =this._movieresult.movieBannerPathforC.split('/'); 
          if(arrLoc[arrLoc.length -1] == "")
          {
            $get('movieinfo', this.get_element()).innerHTML = "<span class='ptMovieNameClientWithoutBanner'>" + this._movieresult.movieNameforC + "</span>" + "<span class='ptSynopsisClient'>" + this._movieresult.movieSynopsisforC + "</span>";        
          }    
          else{
            $get('movieinfo', this.get_element()).innerHTML = "<img src=" + "'" +this._movieresult.movieBannerPathforC+ "'" + "class=" + "'" + "ptMovieBannerClient" + "'" + ">" + "<span class='ptMovieNameClient'>" + this._movieresult.movieNameforC + "</span>" + "<span class='ptSynopsisClient'>" + this._movieresult.movieSynopsisforC + "</span>";        
          }
          if(this._movieresult.movieOffWebSiteforC != "")
          {
			  $get('movieofficialwebsite', this.get_element()).innerHTML = "<a class='ptLink' href=" + "'" + this._movieresult.movieOffWebSiteforC + "'" + "target='_blank'" + "onclick=" +'"' + "LogClient('223', 'portalmain');" + '"' + "  >"+strClientMovieFeatured_OffSite+"</a>";       
          }
          if(this._movieresult.movieTrailerforC != "")
          {
              $get('movietrailer', this.get_element()).innerHTML = "<a class='ptLink' href=" + "'" + this._movieresult.movieTrailerforC + "'" + "target='_blank'" + "onclick=" +'"' + "LogClient('222', 'portalmain');" + '"' + " >"+strClientMovieFeatured_Trailer+"</a>";       
          }   
          $get('theatershowing', this.get_element()).innerHTML = "<div class='hline'/>";
          $get('findshowitme', this.get_element()).innerHTML = "<span class='ptMovieFind'>"+strClientMovieFeatured_LocalTimes+"</span>" + "<div class='ptMovieCity'>"+strClientMovieFeatured_EnterCode+"</div>" + "<input class='ptFrmText' id='featuredMovieinputzipcode' type='text' maxlength='30'>" + "<input id='featuredMoviesubmit' type='button' class='ptFrmButton' value='GO'> <div style='display:none; color:Red' id='errmsg' class='error'> </div>"; 
          
          if (this._buttonClickDelegate === null) 
          {
            this._buttonClickDelegate = Function.createDelegate(this, this.buttonClickDelegateHandler);
          }
          $addHandler($get('featuredMoviesubmit',this.get_element()),'click',this._buttonClickDelegate);
          
          if (this._keyPressDelegate === null) 
          {
            this._keyPressDelegate = Function.createDelegate(this, this.keyPressDelegateHandler);
          }
          $addHandler($get('featuredMovieinputzipcode',this.get_element()),'keypress',this._keyPressDelegate);
          

    },
    _clearComponents: function()
    {
        for(var a in this._components)
        {
            delete this._components[a];
        }
    },
    
    addComponent:function(e)
    {
        if(Sys.Component.isInstanceOfType(e))
            this._components[e.get_id()] = e;
    },
    getComponents:function()
    { 
        var a=[];b= this._components;
        for(var c in b)
        {
            a[a.length] = b[c];
        }
        return a;
    },
    findComponent:function(id)
    {
        return this._components[id];
    },
    removeComponent:function(b)
    {
        var a = b.get_id();
        if(a){delete this._components[a];}
    }
}

Insp.UI.ClientMovie.registerClass('Insp.UI.ClientMovie',Insp.UI.ModuleContentCtl,Sys.IContainer);

if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
